Example #1
0
        public override byte[] CreateKeyExchange(byte[] rgbData)
        {
            if (random == null)
            {
                random = RandomNumberGenerator.Create();                   // create default
            }
            if (rsa == null)
            {
                string msg = Locale.GetText("No RSA key specified");
                throw new CryptographicUnexpectedOperationException(msg);
            }
            SHA1 sha1 = SHA1.Create();

            return(PKCS1.Encrypt_OAEP(rsa, sha1, random, rgbData));
        }