Esempio n. 1
0
        public static string DecryptToken(string encryptedConnectToken, AsymmetricCipherKeyPair keyPair)
        {
            // token was encoded as a urlsafe base64 so it can be transfered in a url
            byte[] cipherBytes = Conversion.UrlSafeBase64ToBytes(encryptedConnectToken);

            byte[] decipheredBytes = DecryptRsa(cipherBytes, keyPair);

            return(Conversion.BytesToUtf8(decipheredBytes));
        }
Esempio n. 2
0
        internal static string DecryptToken(string encryptedConnectToken, AsymmetricCipherKeyPair keyPair)
        {
            Validation.NotNullOrEmpty(encryptedConnectToken, "one time use token");

            // token was encoded as a URL-safe base64 so it can be transferred in a URL
            byte[] cipherBytes = Conversion.UrlSafeBase64ToBytes(encryptedConnectToken);

            byte[] decipheredBytes = DecryptRsa(cipherBytes, keyPair);

            return(Conversion.BytesToUtf8(decipheredBytes));
        }