AesCng.CreateDecryptor AesCng.CreateDecryptor AesCng.CreateDecryptor AesCng.CreateDecryptor Method

定义

创建对称解密器对象。Creates a symmetric decryptor object.

重载

CreateDecryptor() CreateDecryptor() CreateDecryptor() CreateDecryptor()

用当前键和初始化向量 (IV) 创建对称 AES 解密器对象。Creates a symmetric AES decryptor object with the current key and initialization vector (IV).

CreateDecryptor(Byte[], Byte[]) CreateDecryptor(Byte[], Byte[]) CreateDecryptor(Byte[], Byte[]) CreateDecryptor(Byte[], Byte[])

用指定的密钥和初始化向量 (IV) 创建对称 AES 解密器对象。Creates a symmetric AES decryptor object with the specified key and initialization vector (IV).

CreateDecryptor() CreateDecryptor() CreateDecryptor() CreateDecryptor()

用当前键和初始化向量 (IV) 创建对称 AES 解密器对象。Creates a symmetric AES decryptor object with the current key and initialization vector (IV).

public:
 override System::Security::Cryptography::ICryptoTransform ^ CreateDecryptor();
public override System.Security.Cryptography.ICryptoTransform CreateDecryptor ();
override this.CreateDecryptor : unit -> System.Security.Cryptography.ICryptoTransform
Public Overrides Function CreateDecryptor () As ICryptoTransform

返回

对称 AES 解密器对象。A symmetric AES decryptor object.

注解

此方法会解密已加密的邮件使用创建CreateEncryptor()重载具有相同的签名。This method decrypts an encrypted message created using the CreateEncryptor() overload with the same signature.

CreateDecryptor(Byte[], Byte[]) CreateDecryptor(Byte[], Byte[]) CreateDecryptor(Byte[], Byte[]) CreateDecryptor(Byte[], Byte[])

用指定的密钥和初始化向量 (IV) 创建对称 AES 解密器对象。Creates a symmetric AES decryptor object with the specified key and initialization vector (IV).

public:
 override System::Security::Cryptography::ICryptoTransform ^ CreateDecryptor(cli::array <System::Byte> ^ rgbKey, cli::array <System::Byte> ^ rgbIV);
public override System.Security.Cryptography.ICryptoTransform CreateDecryptor (byte[] rgbKey, byte[] rgbIV);
override this.CreateDecryptor : byte[] * byte[] -> System.Security.Cryptography.ICryptoTransform
Public Overrides Function CreateDecryptor (rgbKey As Byte(), rgbIV As Byte()) As ICryptoTransform

参数

rgbKey
Byte[]

用于 AES 算法的密钥。The secret key to use for the AES algorithm. 密钥大小必须为 128、192 或 256 位。The key size must be 128, 192, or 256 bits.

rgbIV
Byte[]

用于 AES 算法的初始化向量。The initialization vector to use for the AES algorithm.

返回

对称 AES 解密器对象。A symmetric AES decryptor object.

异常

rgbKey 的大小对于此算法无效。rgbKey is not a valid size for this algorithm.

- 或 --or- rgbIV 的大小与此算法的块大小不匹配。rgbIV size does not match the block size for this algorithm.

rgbKey 是此算法的已知弱密钥,不能使用。rgbKey is a known weak key for this algorithm and cannot be used.

- 或 --or- rgbIVnullrgbIV is null.

注解

此方法会解密已加密的邮件使用创建CreateEncryptor(Byte[], Byte[])重载具有相同的签名。This method decrypts an encrypted message created using the CreateEncryptor(Byte[], Byte[]) overload with the same signature.

备注

如果你已创建AesCng对象使用的现有的保留的密钥和你想要使用的密钥解密消息时,你想要设置IV属性,然后调用无参数CreateDecryptor()重载改为; 否则为使用此方法将创建由指定一个暂时的密钥rgbKey参数。If you've created the AesCng object using an existing persisted key and you want to make use of that key when decrypting the message, you want to set the IV property and then call the parameterless CreateDecryptor() overload instead; otherwise, using this method will create an ephemeral key as specified by the rgbKey parameter.

适用于