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)); }
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)); }