src/java.base/share/classes/sun/security/ssl/PreSharedKeyExtension.java
branchJDK-8145252-TLS13-branch
changeset 56708 25178bb3e8f5
parent 56703 33a2451070d3
equal deleted inserted replaced
56707:929ac4f1cddd 56708:25178bb3e8f5
    51             new CHPreSharedKeyConsumer();
    51             new CHPreSharedKeyConsumer();
    52     static final HandshakeAbsence chOnLoadAbsence =
    52     static final HandshakeAbsence chOnLoadAbsence =
    53             new CHPreSharedKeyAbsence();
    53             new CHPreSharedKeyAbsence();
    54     static final HandshakeConsumer chOnTradeConsumer =
    54     static final HandshakeConsumer chOnTradeConsumer =
    55             new CHPreSharedKeyUpdate();
    55             new CHPreSharedKeyUpdate();
    56     static final SSLStringize chStringize =
    56     static final SSLStringizer chStringizer =
    57             new CHPreSharedKeyStringize();
    57             new CHPreSharedKeyStringizer();
    58 
    58 
    59     static final HandshakeProducer shNetworkProducer =
    59     static final HandshakeProducer shNetworkProducer =
    60             new SHPreSharedKeyProducer();
    60             new SHPreSharedKeyProducer();
    61     static final ExtensionConsumer shOnLoadConsumer =
    61     static final ExtensionConsumer shOnLoadConsumer =
    62             new SHPreSharedKeyConsumer();
    62             new SHPreSharedKeyConsumer();
    63     static final HandshakeAbsence shOnLoadAbsence =
    63     static final HandshakeAbsence shOnLoadAbsence =
    64             new SHPreSharedKeyAbsence();
    64             new SHPreSharedKeyAbsence();
    65     static final SSLStringize shStringize =
    65     static final SSLStringizer shStringizer =
    66             new SHPreSharedKeyStringize();
    66             new SHPreSharedKeyStringizer();
    67 
    67 
    68     private static final class PskIdentity {
    68     private static final class PskIdentity {
    69         final byte[] identity;
    69         final byte[] identity;
    70         final int obfuscatedAge;
    70         final int obfuscatedAge;
    71 
    71 
   236             return result.toString();
   236             return result.toString();
   237         }
   237         }
   238     }
   238     }
   239 
   239 
   240     private static final
   240     private static final
   241             class CHPreSharedKeyStringize implements SSLStringize {
   241             class CHPreSharedKeyStringizer implements SSLStringizer {
   242         @Override
   242         @Override
   243         public String toString(ByteBuffer buffer) {
   243         public String toString(ByteBuffer buffer) {
   244             try {
   244             try {
   245                 // As the HandshakeContext parameter of CHPreSharedKeySpec
   245                 // As the HandshakeContext parameter of CHPreSharedKeySpec
   246                 // constructor is used for fatal alert only, we can use
   246                 // constructor is used for fatal alert only, we can use
   297             return messageFormat.format(messageFields);
   297             return messageFormat.format(messageFields);
   298         }
   298         }
   299     }
   299     }
   300 
   300 
   301     private static final
   301     private static final
   302             class SHPreSharedKeyStringize implements SSLStringize {
   302             class SHPreSharedKeyStringizer implements SSLStringizer {
   303         @Override
   303         @Override
   304         public String toString(ByteBuffer buffer) {
   304         public String toString(ByteBuffer buffer) {
   305             try {
   305             try {
   306                 // As the HandshakeContext parameter of SHPreSharedKeySpec
   306                 // As the HandshakeContext parameter of SHPreSharedKeySpec
   307                 // constructor is used for fatal alert only, we can use
   307                 // constructor is used for fatal alert only, we can use