/// <summary>Extracts secret information from the encrypted key exchange data.</summary> /// <returns>The secret information derived from the key exchange data.</returns> /// <param name="rgbIn">The key exchange data within which the secret information is hidden. </param> /// <exception cref="T:System.Security.Cryptography.CryptographicUnexpectedOperationException">The key is missing.</exception> /// <PermissionSet> /// <IPermission class="System.Security.Permissions.KeyContainerPermission, mscorlib, Version=2.0.3600.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" version="1" Unrestricted="true" /> /// </PermissionSet> public override byte[] DecryptKeyExchange(byte[] rgbIn) { if (this.rsa == null) { throw new CryptographicUnexpectedOperationException(Locale.GetText("No key pair available.")); } byte[] array = PKCS1.Decrypt_v15(this.rsa, rgbIn); if (array != null) { return(array); } throw new CryptographicException(Locale.GetText("PKCS1 decoding error.")); }
public override byte[] DecryptKeyExchange(byte[] rgbData) { if (rsa == null) { throw new CryptographicUnexpectedOperationException( Locale.GetText("No key pair available.")); } byte[] result = PKCS1.Decrypt_v15(rsa, rgbData); if (result != null) { return(result); } throw new CryptographicException(Locale.GetText("PKCS1 decoding error.")); }