AesGcm.Decrypt 方法

定義

多載

Decrypt(Byte[], Byte[], Byte[], Byte[], Byte[])

如果可對驗證標記進行驗證,則將加密文字解密至提供的目的地緩衝區。

Decrypt(ReadOnlySpan<Byte>, ReadOnlySpan<Byte>, ReadOnlySpan<Byte>, Span<Byte>, ReadOnlySpan<Byte>)

如果可對驗證標記進行驗證,則將加密文字解密至提供的目的地緩衝區。

Decrypt(Byte[], Byte[], Byte[], Byte[], Byte[])

如果可對驗證標記進行驗證,則將加密文字解密至提供的目的地緩衝區。

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

與這個訊息建立關聯的 nonce,必須符合加密期間所提供的值。

ciphertext
Byte[]

要解密的加密內容。

tag
Byte[]

在加密期間為了這個訊息所產生的驗證標記。

plaintext
Byte[]

要接收解密內容的位元組陣列。

associatedData
Byte[]

與這個訊息建立關聯的額外資料,必須符合加密期間所提供的值。

例外狀況

plaintext 參數與 ciphertext 的長度不同。

-或-

NonceByteSizes 不允許 nonce 參數長度。

-或-

TagByteSizes 不允許 tag 參數長度。

nonceciphertexttagplaintext 參數是 null

無法驗證標記值,或解密作業失敗。

備註

如果 tag 無法使用索引鍵、 nonceciphertextassociatedData 值) 驗證 (,則會 plaintext 清除 。

適用於

Decrypt(ReadOnlySpan<Byte>, ReadOnlySpan<Byte>, ReadOnlySpan<Byte>, Span<Byte>, ReadOnlySpan<Byte>)

如果可對驗證標記進行驗證,則將加密文字解密至提供的目的地緩衝區。

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>

與這個訊息建立關聯的 nonce,必須符合加密期間所提供的值。

ciphertext
ReadOnlySpan<Byte>

要解密的加密內容。

tag
ReadOnlySpan<Byte>

在加密期間為了這個訊息所產生的驗證標記。

plaintext
Span<Byte>

要接收解密內容的位元組範圍。

associatedData
ReadOnlySpan<Byte>

與這個訊息建立關聯的額外資料,必須符合加密期間所提供的值。

例外狀況

plaintext 參數與 ciphertext 的長度不同。

-或-

NonceByteSizes 不允許 nonce 參數長度。

-或-

TagByteSizes 不允許 tag 參數長度。

無法驗證標記值,或解密作業失敗。

備註

如果 tag 無法使用索引鍵、 nonceciphertextassociatedData 值) 驗證 (,則會 plaintext 清除 。

適用於