Click or drag to resize

RsaEncrypt Method

Encrypts the specified data by providing encryption key and other data, with a PKCS#12 certificate (*.pfx file)

Namespace:  Hummingbird.TestFramework.Cryptography
Assembly:  Hummingbird.TestFramework (in Hummingbird.TestFramework.dll) Version: 1.2.0.0
Syntax
public override byte[] Encrypt(
	byte[] key,
	byte[] iv,
	X509Certificate2 certificate,
	byte[] data,
	CipherMode ciphermode,
	PaddingMode paddingmode
)

Parameters

key
Type: SystemByte
The key is not used.
iv
Type: SystemByte
The Initial Vector.
certificate
Type: System.Security.Cryptography.X509CertificatesX509Certificate2
The X509 certificate, if the algorithm needs a certificate.
data
Type: SystemByte
The data to be encrypted.
ciphermode
Type: System.Security.CryptographyCipherMode
The cipher mode.
paddingmode
Type: System.Security.CryptographyPaddingMode
The padding mode.

Return Value

Type: Byte
the encrypted data. For hash methods, the hashed data
Exceptions
ExceptionCondition
ArgumentNullExceptionThe certificate has not been provided.\nTo use RSA encryption or decryption, a valid PKCS#12 certificate (*.pfx file) must be provided.
Remarks
RSA is an asymmetric encryption method. We uses the public key to encrypt data and private key to decrypt data. The key parameter is not used.
See Also