AesGcm.Decrypt 方法
定義
重要
部分資訊涉及發行前產品,在發行之前可能會有大幅修改。 Microsoft 對此處提供的資訊,不做任何明確或隱含的瑕疵擔保。
多載
| 名稱 | Description |
|---|---|
| Decrypt(Byte[], Byte[], Byte[], Byte[], Byte[]) |
若能驗證認證標籤,則會將密文解密至目的緩衝區。 |
| Decrypt(ReadOnlySpan<Byte>, ReadOnlySpan<Byte>, ReadOnlySpan<Byte>, Span<Byte>, ReadOnlySpan<Byte>) |
若能驗證認證標籤,則會將密文解密至目的緩衝區。 |
Decrypt(Byte[], Byte[], Byte[], Byte[], Byte[])
- 來源:
- AesGcm.cs
- 來源:
- AesGcm.cs
- 來源:
- AesGcm.cs
- 來源:
- AesGcm.cs
- 來源:
- AesGcm.cs
若能驗證認證標籤,則會將密文解密至目的緩衝區。
public void Decrypt(byte[] nonce, byte[] ciphertext, byte[] tag, byte[] plaintext, byte[]? associatedData = default);
public void Decrypt(byte[] nonce, byte[] ciphertext, byte[] tag, byte[] plaintext, byte[] associatedData = default);
member this.Decrypt : byte[] * byte[] * byte[] * byte[] * byte[] -> unit
Public Sub Decrypt (nonce As Byte(), ciphertext As Byte(), tag As Byte(), plaintext As Byte(), Optional associatedData As Byte() = Nothing)
參數
- nonce
- Byte[]
與此訊息相關的 nonx,必須與加密時提供的值相符。
- ciphertext
- Byte[]
要解密的加密內容。
- tag
- Byte[]
加密時為此訊息產生的認證標籤。
- plaintext
- Byte[]
位元組陣列用來接收解密內容。
- associatedData
- Byte[]
與此訊息相關的額外資料,必須與加密時提供的值相符。
例外狀況
參數 nonce, ciphertext, tag, 或 plaintext 為 null。
解密行動失敗。 在 .NET 8 之前,表示標籤值無法驗證。
.NET 8 及以後版本:標籤值無法驗證。
備註
若 tag 無法驗證(使用鍵、 nonce、 ciphertext及 associatedData 值),則 plaintext 清除。
適用於
Decrypt(ReadOnlySpan<Byte>, ReadOnlySpan<Byte>, ReadOnlySpan<Byte>, Span<Byte>, ReadOnlySpan<Byte>)
- 來源:
- AesGcm.cs
- 來源:
- AesGcm.cs
- 來源:
- AesGcm.cs
- 來源:
- AesGcm.cs
- 來源:
- AesGcm.cs
若能驗證認證標籤,則會將密文解密至目的緩衝區。
public void Decrypt(ReadOnlySpan<byte> nonce, ReadOnlySpan<byte> ciphertext, ReadOnlySpan<byte> tag, Span<byte> plaintext, ReadOnlySpan<byte> associatedData = default);
member this.Decrypt : ReadOnlySpan<byte> * ReadOnlySpan<byte> * ReadOnlySpan<byte> * Span<byte> * ReadOnlySpan<byte> -> unit
Public Sub Decrypt (nonce As ReadOnlySpan(Of Byte), ciphertext As ReadOnlySpan(Of Byte), tag As ReadOnlySpan(Of Byte), plaintext As Span(Of Byte), Optional associatedData As ReadOnlySpan(Of Byte) = Nothing)
參數
- nonce
- ReadOnlySpan<Byte>
與此訊息相關的 nonx,必須與加密時提供的值相符。
- ciphertext
- ReadOnlySpan<Byte>
要解密的加密內容。
- tag
- ReadOnlySpan<Byte>
加密時為此訊息產生的認證標籤。
- associatedData
- ReadOnlySpan<Byte>
與此訊息相關的額外資料,必須與加密時提供的值相符。
例外狀況
解密行動失敗。 在 .NET 8 之前,表示標籤值無法驗證。
.NET 8 及以後版本:標籤值無法驗證。
備註
若 tag 無法驗證(使用鍵、 nonce、 ciphertext及 associatedData 值),則 plaintext 清除。