Share via


TripleDESCng.CreateDecryptor 方法

定義

建立對稱解密子物件。

多載

CreateDecryptor()

使用目前的索引鍵和初始化向量 (IV) 建立對稱 3DES 解密子物件。

CreateDecryptor(Byte[], Byte[])

使用指定的金鑰和初始化向量 (IV) 建立對稱 3DES 解密子物件。

CreateDecryptor()

使用目前的索引鍵和初始化向量 (IV) 建立對稱 3DES 解密子物件。

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

傳回

對稱 3DES 解密子物件。

例外狀況

.NET 6 和更新版本:已選取 CFB64 模式並保存密鑰。

備註

這個方法會解密使用具有相同簽章的多 CreateEncryptor() 載所建立的加密訊息。

適用於

CreateDecryptor(Byte[], Byte[])

來源:
Cng.NotSupported.cs
來源:
Cng.NotSupported.cs
來源:
Cng.NotSupported.cs

使用指定的金鑰和初始化向量 (IV) 建立對稱 3DES 解密子物件。

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);
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[]

3DES 演算法所用的祕密金鑰。 金鑰大小必須是 192 位元。

rgbIV
Byte[]

3DES 演算法所用的初始化向量。

傳回

對稱 3DES 解密子物件。

例外狀況

rgbKeynull

rgbKey 的大小不適用於此演算法。

-或-

rgbIV 的大小不符合此演算法的區塊大小。

rgbKey 是此演算法的已知弱式金鑰,因此無法使用。

-或-

rgbIVnull

備註

這個方法會解密使用具有相同簽章的多 CreateEncryptor(Byte[], Byte[]) 載所建立的加密訊息。

注意

如果您已使用現有的保存金鑰建立 TripleDESCng 物件,而且想要在解密訊息時使用該金鑰,則您想要設定 IV 屬性,然後改為呼叫無 CreateDecryptor() 參數多載;否則,使用此方法會建立參數所 rgbKey 指定的暫時密鑰。

適用於