Click or drag to resize

RsaDecrypt Method

Decrypt a message encrypted using an RSA encryption scheme.

Namespace: CryptoSysPKI
Assembly: diCrSysPKINet (in diCrSysPKINet.dll) Version: 23.0.0.30549 (23.1.0.0)
Syntax
public static byte[] Decrypt(
	byte[] data,
	string privateKeyFile,
	string password = "",
	RsaEME method = RsaEME.PKCSv1_5,
	RsaHashAlg hashAlg = RsaHashAlg.Sha1,
	RsaAdvOptions advOpts = RsaAdvOptions.Default
)

Parameters

data  Byte
Data to be decrypted (must be exactly the same length as the key modulus size).
privateKeyFile  String
Name of the private key file, or a string containing the key in PEM format, or a valid internal private key string.
password  String  (Optional)
Password for encrypted private key, or "" if password is not required.
method  RsaEME  (Optional)
Encoding method [optional, default = EME.PKCSv1_5]
hashAlg  RsaHashAlg  (Optional)
Hash function for EME-OAEP encoding, otherwise ignored.
advOpts  RsaAdvOptions  (Optional)
Advanced options for EME-OEAP only.

Return Value

Byte
Decrypted data.
Remarks
For RSA-OAEP you must set the correct options to match the parameters used for the encryption.
See Also