AesGcm 类

定义

表示要与 Galois/Counter Mode (GCM) 操作模式一起使用的高级加密标准 (AES) 密钥。

C#
[System.Runtime.Versioning.UnsupportedOSPlatform("browser")]
public sealed class AesGcm : IDisposable
C#
[System.Runtime.Versioning.UnsupportedOSPlatform("browser")]
[System.Runtime.Versioning.UnsupportedOSPlatform("ios")]
[System.Runtime.Versioning.UnsupportedOSPlatform("tvos")]
public sealed class AesGcm : IDisposable
C#
[System.Runtime.Versioning.UnsupportedOSPlatform("browser")]
[System.Runtime.Versioning.UnsupportedOSPlatform("ios")]
[System.Runtime.Versioning.UnsupportedOSPlatform("tvos")]
[System.Runtime.Versioning.SupportedOSPlatform("ios13.0")]
[System.Runtime.Versioning.SupportedOSPlatform("tvos13.0")]
public sealed class AesGcm : IDisposable
C#
public sealed class AesGcm : IDisposable
继承
AesGcm
属性
实现

构造函数

AesGcm(Byte[])
已过时.

使用提供的键初始化 AesGcm 类的新实例。

AesGcm(Byte[], Int32)

使用提供的键和所需的标记大小初始化 AesGcm 类的新实例。

AesGcm(ReadOnlySpan<Byte>)
已过时.

使用提供的键初始化 AesGcm 类的新实例。

AesGcm(ReadOnlySpan<Byte>, Int32)

使用提供的键和所需的标记大小初始化 AesGcm 类的新实例。

属性

IsSupported

获取一个值,该值指示当前平台上是否支持该算法。

NonceByteSizes

获取此实例支持的 nonce 大小(以字节为单位)。

TagByteSizes

获取此实例支持的标记大小(以字节为单位)。

TagSizeInBytes

获取标记的大小(以字节为单位)。

方法

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

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

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

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

Dispose()

释放 AesGcm 类的当前实例使用的资源。

Encrypt(Byte[], Byte[], Byte[], Byte[], Byte[])

将纯文本加密到密码文本目标缓冲区,并将身份验证标记生成到单独的缓冲区中。

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

将纯文本加密到密码文本目标缓冲区,并将身份验证标记生成到单独的缓冲区中。

Equals(Object)

确定指定的对象是否等于当前对象。

(继承自 Object)
GetHashCode()

用作默认哈希函数。

(继承自 Object)
GetType()

获取当前实例的 Type

(继承自 Object)
MemberwiseClone()

创建当前 Object的浅表副本。

(继承自 Object)
ToString()

返回一个表示当前对象的字符串。

(继承自 Object)

适用于

产品 版本
.NET Core 3.0, Core 3.1, 5, 6, 7, 8, 9
.NET Standard 2.1