AesCcm.Encrypt 方法
定义
重要
一些信息与预发行产品相关,相应产品在发行之前可能会进行重大修改。 对于此处提供的信息,Microsoft 不作任何明示或暗示的担保。
重载
| 名称 | 说明 |
|---|---|
| Encrypt(Byte[], Byte[], Byte[], Byte[], Byte[]) |
将纯文本加密到密码文本目标缓冲区,并将身份验证标记生成到单独的缓冲区中。 |
| Encrypt(ReadOnlySpan<Byte>, ReadOnlySpan<Byte>, Span<Byte>, Span<Byte>, ReadOnlySpan<Byte>) |
将纯文本加密到密码文本目标缓冲区,并将身份验证标记生成到单独的缓冲区中。 |
Encrypt(Byte[], Byte[], Byte[], Byte[], Byte[])
- Source:
- AesCcm.cs
- Source:
- AesCcm.cs
- Source:
- AesCcm.cs
- Source:
- AesCcm.cs
- Source:
- AesCcm.cs
将纯文本加密到密码文本目标缓冲区,并将身份验证标记生成到单独的缓冲区中。
public void Encrypt(byte[] nonce, byte[] plaintext, byte[] ciphertext, byte[] tag, byte[]? associatedData = default);
public void Encrypt(byte[] nonce, byte[] plaintext, byte[] ciphertext, byte[] tag, byte[] associatedData = default);
member this.Encrypt : byte[] * byte[] * byte[] * byte[] * byte[] -> unit
Public Sub Encrypt (nonce As Byte(), plaintext As Byte(), ciphertext As Byte(), tag As Byte(), Optional associatedData As Byte() = Nothing)
参数
- nonce
- Byte[]
与此消息关联的 nonce,对于具有相同键的每个操作,该消息应该是唯一值。
- plaintext
- Byte[]
要加密的内容。
- ciphertext
- Byte[]
要接收加密内容的字节数组。
- tag
- Byte[]
要接收生成的身份验证标记的字节数组。
- associatedData
- Byte[]
与此消息关联的额外数据,在解密期间也必须提供这些数据。
例外
参数 plaintext 和 ciphertext 长度不相同。
-或-
参数 nonce 长度不允许由 NonceByteSizes.
-或-
参数 tag 长度不允许由 TagByteSizes.
、nonceciphertext、tag或plaintext参数为 null。
加密操作失败。
注解
AES-CCM 算法模式的安全保证要求,同一个 nonce 值永远不会使用相同的键两次。
适用于
Encrypt(ReadOnlySpan<Byte>, ReadOnlySpan<Byte>, Span<Byte>, Span<Byte>, ReadOnlySpan<Byte>)
- Source:
- AesCcm.cs
- Source:
- AesCcm.cs
- Source:
- AesCcm.cs
- Source:
- AesCcm.cs
- Source:
- AesCcm.cs
将纯文本加密到密码文本目标缓冲区,并将身份验证标记生成到单独的缓冲区中。
public void Encrypt(ReadOnlySpan<byte> nonce, ReadOnlySpan<byte> plaintext, Span<byte> ciphertext, Span<byte> tag, ReadOnlySpan<byte> associatedData = default);
member this.Encrypt : ReadOnlySpan<byte> * ReadOnlySpan<byte> * Span<byte> * Span<byte> * ReadOnlySpan<byte> -> unit
Public Sub Encrypt (nonce As ReadOnlySpan(Of Byte), plaintext As ReadOnlySpan(Of Byte), ciphertext As Span(Of Byte), tag As Span(Of Byte), Optional associatedData As ReadOnlySpan(Of Byte) = Nothing)
参数
- nonce
- ReadOnlySpan<Byte>
与此消息关联的 nonce,对于具有相同键的每个操作,该消息应该是唯一值。
- plaintext
- ReadOnlySpan<Byte>
要加密的内容。
- associatedData
- ReadOnlySpan<Byte>
与此消息关联的额外数据,在解密期间也必须提供这些数据。
例外
参数 plaintext 和 ciphertext 长度不相同。
-或-
参数 nonce 长度不允许由 NonceByteSizes.
-或-
参数 tag 长度不允许由 TagByteSizes.
加密操作失败。
注解
AES-CCM 算法模式的安全保证要求,同一个 nonce 值永远不会使用相同的键两次。