コード例 #1
0
 public static byte[] ReadNegotiatedDheGroupsClientExtension(byte[] extensionData)
 {
     byte[] dheGroups = TlsUtilities.DecodeUint8ArrayWithUint8Length(extensionData);
     if (dheGroups.Length < 1)
     {
         throw new TlsFatalAlert(AlertDescription.decode_error);
     }
     return(dheGroups);
 }
コード例 #2
0
 /// <exception cref="IOException"></exception>
 public static byte[] ReadCertificateTypeExtensionClient(byte[] extensionData)
 {
     byte[] certificateTypes = TlsUtilities.DecodeUint8ArrayWithUint8Length(extensionData);
     if (certificateTypes.Length < 1)
     {
         throw new TlsFatalAlert(AlertDescription.decode_error);
     }
     return(certificateTypes);
 }
コード例 #3
0
 public static byte[] ReadSupportedPointFormatsExtension(byte[] extensionData)
 {
     byte[] ecPointFormats = TlsUtilities.DecodeUint8ArrayWithUint8Length(extensionData);
     if (!Arrays.Contains(ecPointFormats, ECPointFormat.uncompressed))
     {
         /*
          * RFC 4492 5.1. If the Supported Point Formats Extension is indeed sent, it MUST
          * contain the value 0 (uncompressed) as one of the items in the list of point formats.
          */
         throw new TlsFatalAlert(AlertDescription.illegal_parameter);
     }
     return(ecPointFormats);
 }