GetEncryptionAlgorithm() public static method

public static GetEncryptionAlgorithm ( int ciphersuite ) : int
ciphersuite int
return int
Esempio n. 1
0
        public override TlsCipher GetCipher()
        {
            int encryptionAlgorithm = TlsUtilities.GetEncryptionAlgorithm(mSelectedCipherSuite);
            int macAlgorithm        = TlsUtilities.GetMacAlgorithm(mSelectedCipherSuite);

            return(mCipherFactory.CreateCipher(mContext, encryptionAlgorithm, macAlgorithm));
        }
Esempio n. 2
0
 /// <exception cref="IOException"/>
 protected static void ValidateSelectedCipherSuite(int selectedCipherSuite, byte alertDescription)
 {
     switch (TlsUtilities.GetEncryptionAlgorithm(selectedCipherSuite))
     {
     case EncryptionAlgorithm.RC4_40:
     case EncryptionAlgorithm.RC4_128:
         throw new TlsFatalAlert(alertDescription);
     }
 }
Esempio n. 3
0
        protected static void ValidateSelectedCipherSuite(int selectedCipherSuite, byte alertDescription)
        {
            switch (TlsUtilities.GetEncryptionAlgorithm(selectedCipherSuite))
            {
            case 1:
            case 2:
                throw new TlsFatalAlert(alertDescription);

            default:
                return;
            }
        }