Rsa.Decrypt Method
Decrypt a message encrypted using an RSA encryption scheme.
Syntax
[C#]
public static byte[] Decrypt(
byte[] data,
string privateKeyFile,
string password,
Rsa.EME method,
Rsa.HashAlg hashAlg,
Rsa.AdvOptions advOpts
)
[VB.NET]
Public Shared Function Decrypt ( _
data As Byte(), _
privateKeyFile As String, _
password As String, _
method As Rsa.EME, _
hashAlg As Rsa.HashAlg, _
advOpts As Rsa.AdvOptions _
) As Byte()
Parameters
- data
- Data to be decrypted (must be exactly the same length as the key modulus size).
- privateKeyFile
- Name of the private key file, or a string containing the key in PEM format, or a valid internal private key string.
- password
- Password for encrypted private key, or "" if password is not required.
- method
- Type: Rsa.EME
Encoding method [optional, default = EME.PKCSv1_5]
- hashAlg
- Type: Rsa.HashAlg
Hash function for EME-OAEP encoding, otherwise ignored.
- advOpts
- Type: Rsa.AdvOptions
Advanced options for EME-OEAP only.
Return Value
Decrypted data.
Remarks
For RSA-OAEP you must set the correct options to match the parameters used for the encryption.
See Also
VB6/C equivalent: RSA_Decrypt
[Contents] [Index]