AesCcm.Decrypt 方法

定义

重载

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

如果可验证身份验证标记,则将已加密文本解密到提供的目标缓冲区中。

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

如果可验证身份验证标记,则将已加密文本解密到提供的目标缓冲区中。

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

Source:
AesCcm.cs
Source:
AesCcm.cs
Source:
AesCcm.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[]

与此消息关联的 nonce。它必须与加密过程中提供的值相匹配。

ciphertext
Byte[]

要解密的加密内容。

tag
Byte[]

加密过程中为此消息生成的身份验证标记。

plaintext
Byte[]

接收解密内容的字节数组。

associatedData
Byte[]

与此消息关联的额外数据。该数据必须与加密过程中提供的值相匹配。

例外

plaintext 参数和 ciphertext 的长度不同。

- 或 -

nonce 参数长度不被 NonceByteSizes 所允许。

- 或 -

tag 参数长度不被 TagByteSizes 所允许。

nonceciphertexttagplaintext 参数为 null

无法验证标记值,或者解密操作失败。

注解

如果tag无法使用键、 nonceciphertext、 和 associatedData 值) 验证 (,则plaintext清除 。

适用于

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

Source:
AesCcm.cs
Source:
AesCcm.cs
Source:
AesCcm.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>

与此消息关联的 nonce。它必须与加密过程中提供的值相匹配。

ciphertext
ReadOnlySpan<Byte>

要解密的加密内容。

tag
ReadOnlySpan<Byte>

加密过程中为此消息生成的身份验证标记。

plaintext
Span<Byte>

接收解密内容的字节范围。

associatedData
ReadOnlySpan<Byte>

与此消息关联的额外数据。该数据必须与加密过程中提供的值相匹配。

例外

plaintext 参数和 ciphertext 的长度不同。

- 或 -

nonce 参数长度不被 NonceByteSizes 所允许。

- 或 -

tag 参数长度不被 TagByteSizes 所允许。

无法验证标记值,或者解密操作失败。

注解

如果tag无法使用键、 nonceciphertext、 和 associatedData 值) 验证 (,则plaintext清除 。

适用于