AesCng.CreateDecryptor Method
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
Creates a symmetric decryptor object.
Overloads
CreateDecryptor() |
Creates a symmetric AES decryptor object with the current key and initialization vector (IV). |
CreateDecryptor(Byte[], Byte[]) |
Creates a symmetric AES decryptor object with the specified key and initialization vector (IV). |
CreateDecryptor()
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
Returns
A symmetric AES decryptor object.
Exceptions
.NET 6 and later: CFB128 mode is selected and the key is persisted.
Remarks
This method decrypts an encrypted message created using the CreateEncryptor() overload with the same signature.
Applies to
CreateDecryptor(Byte[], Byte[])
- Source:
- Cng.NotSupported.cs
- Source:
- Cng.NotSupported.cs
- Source:
- Cng.NotSupported.cs
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);
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
Parameters
- rgbKey
- Byte[]
The secret key to use for the AES algorithm. The key size must be 128, 192, or 256 bits.
- rgbIV
- Byte[]
The initialization vector to use for the AES algorithm.
Returns
A symmetric AES decryptor object.
Exceptions
rgbKey
is null
.
rgbKey
is not a valid size for this algorithm.
-or-
rgbIV
size does not match the block size for this algorithm.
rgbKey
is a known weak key for this algorithm and cannot be used.
-or-
rgbIV
is null
.
Remarks
This method decrypts an encrypted message created using the CreateEncryptor(Byte[], Byte[]) overload with the same signature.
Note
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.
Applies to
.NET
피드백
https://aka.ms/ContentUserFeedback
출시 예정: 2024년 내내 콘텐츠에 대한 피드백 메커니즘으로 GitHub 문제를 단계적으로 폐지하고 이를 새로운 피드백 시스템으로 바꿀 예정입니다. 자세한 내용은 다음을 참조하세요.다음에 대한 사용자 의견 제출 및 보기