Skip to content

Decrypt Method ​

Definition ​

  • Namespace: JASE.Crypto
  • Assembly: JASE.Crypto.dll

Overloads ​

NameDescription
byte[] Decrypt(byte[] input, byte[] key, RsaPadding padding = null)Decrypts the specified data using an RSA private key provided as a byte array.
byte[] Decrypt(byte[] input, string keyInXml, RsaPadding padding = null)Decrypts the specified data using an RSA private key provided in XML format.
byte[] Decrypt(byte[] input, X509Certificate2 certificate, RsaPadding padding = null, bool allowInvalidTime = null)Decrypts the input data using the private key of the specified X.509 certificate.

byte[] Decrypt(byte[] input, byte[] key, RsaPadding padding = null) ​

csharp
byte[] Decrypt(byte[] input, byte[] key, RsaPadding padding = null)

Decrypts the specified data using an RSA private key provided as a byte array.

Parameters ​

NameDescription
inputThe encrypted input data as a byte array.
keyThe RSA private key in raw byte array format.
paddingThe RSA padding scheme to use. Default is OaepSHA256.

Returns ​

The decrypted byte array.

byte[] Decrypt(byte[] input, X509Certificate2 certificate, RsaPadding padding = null, bool allowInvalidTime = null) ​

csharp
byte[] Decrypt(byte[] input, X509Certificate2 certificate, RsaPadding padding = null, bool allowInvalidTime = null)

Decrypts the input data using the private key of the specified X.509 certificate.

Parameters ​

NameDescription
allowInvalidTimeBoolean to enforce certificate time frame validity
certificateThe X.509 certificate containing the private key used for decryption.
inputThe input data to decrypt.
paddingThe RSA padding scheme to use. Default is OaepSHA256.

Returns ​

The decrypted data.

byte[] Decrypt(byte[] input, string keyInXml, RsaPadding padding = null) ​

csharp
byte[] Decrypt(byte[] input, string keyInXml, RsaPadding padding = null)

Decrypts the specified data using an RSA private key provided in XML format.

Parameters ​

NameDescription
inputThe encrypted input data as a byte array.
keyInXmlThe RSA private key in XML format. Must be a valid XML string.
paddingThe RSA padding scheme to use. Default is OaepSHA256.

Returns ​

The decrypted byte array.