AesCng AesCng AesCng AesCng Class

定义

提供高级加密标准 (AES) 算法的下一代加密技术 (CNG) 实现。Provides a Cryptography Next Generation (CNG) implementation of the Advanced Encryption Standard (AES) algorithm.

public ref class AesCng sealed : System::Security::Cryptography::Aes
public sealed class AesCng : System.Security.Cryptography.Aes
type AesCng = class
    inherit Aes
Public NotInheritable Class AesCng
Inherits Aes
继承

构造函数

AesCng() AesCng() AesCng() AesCng()

使用临时密钥初始化 AesCng 类的新实例。Initializes a new instance of the AesCng class with an ephemeral key.

AesCng(String) AesCng(String) AesCng(String) AesCng(String)

使用指定密钥名称初始化 AesCng 类的新实例,该密钥名称表示现有的保留的 AES 密钥。Initializes a new instance of the AesCng class with the specified key name, which represents an existing persisted AES key.

AesCng(String, CngProvider) AesCng(String, CngProvider) AesCng(String, CngProvider) AesCng(String, CngProvider)

使用指定的密钥名称和密钥存储提供者 (KSP) 初始化 AesCng 类的新实例,其中指定的密钥名称表示现有的保留的 AES 密钥。Initializes a new instance of the AesCng class with the specified key name, which represents an existing persisted AES key, and the specified key storage provider (KSP).

AesCng(String, CngProvider, CngKeyOpenOptions) AesCng(String, CngProvider, CngKeyOpenOptions) AesCng(String, CngProvider, CngKeyOpenOptions) AesCng(String, CngProvider, CngKeyOpenOptions)

使用指定的密钥名称、密钥存储提供者 (KSP) 和密钥打开选项初始化 AesCng 类的新实例,其中指定的密钥名称表示现有的保留的 AES 密钥。Initializes a new instance of the AesCng class with the specified key name, which represents an existing persisted AES key, the specified key storage provider (KSP) and key open options.

属性

BlockSize BlockSize BlockSize BlockSize

获取或设置加密操作的块大小(以位为单位)。Gets or sets the block size, in bits, of the cryptographic operation.

(Inherited from SymmetricAlgorithm)
FeedbackSize FeedbackSize FeedbackSize FeedbackSize

获取或设置加密操作的反馈大小(以位为单位)。Gets or sets the feedback size, in bits, of the cryptographic operation.

(Inherited from SymmetricAlgorithm)
IV IV IV IV

获取或设置对称算法的初始化向量 (IV)。Gets or sets the initialization vector (IV) for the symmetric algorithm.

(Inherited from SymmetricAlgorithm)
Key Key Key Key

获取或设置 AesCng 算法的密钥。Gets or sets the key for the AesCng algorithm.

KeySize KeySize KeySize KeySize

获取或设置 AesCng 算法所用密钥的大小(以位为单位)。Gets or sets the size, in bits, of the secret key used by the AesCng algorithm.

LegalBlockSizes LegalBlockSizes LegalBlockSizes LegalBlockSizes Inherited from Aes
LegalKeySizes LegalKeySizes LegalKeySizes LegalKeySizes Inherited from Aes
Mode Mode Mode Mode

获取或设置对称算法的运算模式。Gets or sets the mode for operation of the symmetric algorithm.

(Inherited from SymmetricAlgorithm)
Padding Padding Padding Padding

获取或设置对称算法中使用的填充模式。Gets or sets the padding mode used in the symmetric algorithm.

(Inherited from SymmetricAlgorithm)

方法

Clear() Clear() Clear() Clear()

释放 SymmetricAlgorithm 类使用的所有资源。Releases all resources used by the SymmetricAlgorithm class.

(Inherited from SymmetricAlgorithm)
CreateDecryptor() CreateDecryptor() CreateDecryptor() CreateDecryptor()

用当前键和初始化向量 (IV) 创建对称 AES 解密器对象。Creates a symmetric AES decryptor object with the current key and initialization vector (IV).

CreateDecryptor(Byte[], Byte[]) CreateDecryptor(Byte[], Byte[]) CreateDecryptor(Byte[], Byte[]) CreateDecryptor(Byte[], Byte[])

用指定的密钥和初始化向量 (IV) 创建对称 AES 解密器对象。Creates a symmetric AES decryptor object with the specified key and initialization vector (IV).

CreateEncryptor() CreateEncryptor() CreateEncryptor() CreateEncryptor()

使用当前键和初始化向量 (IV) 创建对称 AES 加密器对象。Creates a symmetric AES encryptor object using the current key and initialization vector (IV).

CreateEncryptor(Byte[], Byte[]) CreateEncryptor(Byte[], Byte[]) CreateEncryptor(Byte[], Byte[]) CreateEncryptor(Byte[], Byte[])

用指定的密钥和初始化向量 (IV) 创建对称 AES 加密器对象。Creates a symmetric AES encryptor object with the specified key and initialization vector (IV).

Dispose() Dispose() Dispose() Dispose()

释放 SymmetricAlgorithm 类的当前实例所使用的所有资源。Releases all resources used by the current instance of the SymmetricAlgorithm class.

(Inherited from SymmetricAlgorithm)
Dispose(Boolean) Dispose(Boolean) Dispose(Boolean) Dispose(Boolean)

释放由 SymmetricAlgorithm 占用的非托管资源,还可以另外再释放托管资源。Releases the unmanaged resources used by the SymmetricAlgorithm and optionally releases the managed resources.

(Inherited from SymmetricAlgorithm)
Equals(Object) Equals(Object) Equals(Object) Equals(Object)

确定指定的对象是否等于当前对象。Determines whether the specified object is equal to the current object.

(Inherited from Object)
GenerateIV() GenerateIV() GenerateIV() GenerateIV()

生成用于 AES 算法的随机初始化向量 (IV)。Generates a random initialization vector (IV) to use for the AES algorithm.

GenerateKey() GenerateKey() GenerateKey() GenerateKey()

生成用于 AES 算法的随机密钥。Generates a random key to use for the AES algorithm.

GetHashCode() GetHashCode() GetHashCode() GetHashCode()

作为默认哈希函数。Serves as the default hash function.

(Inherited from Object)
GetType() GetType() GetType() GetType()

获取当前实例的 TypeGets the Type of the current instance.

(Inherited from Object)
MemberwiseClone() MemberwiseClone() MemberwiseClone() MemberwiseClone()

创建当前 Object 的浅表副本。Creates a shallow copy of the current Object.

(Inherited from Object)
ToString() ToString() ToString() ToString()

返回表示当前对象的字符串。Returns a string that represents the current object.

(Inherited from Object)
ValidKeySize(Int32) ValidKeySize(Int32) ValidKeySize(Int32) ValidKeySize(Int32)

确定指定的密钥大小对当前算法是否有效。Determines whether the specified key size is valid for the current algorithm.

(Inherited from SymmetricAlgorithm)

字段

BlockSizeValue BlockSizeValue BlockSizeValue BlockSizeValue

表示加密操作的块大小(以位为单位)。Represents the block size, in bits, of the cryptographic operation.

(Inherited from SymmetricAlgorithm)
FeedbackSizeValue FeedbackSizeValue FeedbackSizeValue FeedbackSizeValue

表示加密操作的反馈大小(以位为单位)。Represents the feedback size, in bits, of the cryptographic operation.

(Inherited from SymmetricAlgorithm)
IVValue IVValue IVValue IVValue

表示对称算法的初始化向量 (IV)。Represents the initialization vector (IV) for the symmetric algorithm.

(Inherited from SymmetricAlgorithm)
KeySizeValue KeySizeValue KeySizeValue KeySizeValue

表示对称算法使用的密钥的大小(以位为单位)。Represents the size, in bits, of the secret key used by the symmetric algorithm.

(Inherited from SymmetricAlgorithm)
KeyValue KeyValue KeyValue KeyValue

表示对称算法的密钥。Represents the secret key for the symmetric algorithm.

(Inherited from SymmetricAlgorithm)
LegalBlockSizesValue LegalBlockSizesValue LegalBlockSizesValue LegalBlockSizesValue

指定对称算法支持的块大小(以位为单位)。Specifies the block sizes, in bits, that are supported by the symmetric algorithm.

(Inherited from SymmetricAlgorithm)
LegalKeySizesValue LegalKeySizesValue LegalKeySizesValue LegalKeySizesValue

指定对称算法支持的密钥大小(以位为单位)。Specifies the key sizes, in bits, that are supported by the symmetric algorithm.

(Inherited from SymmetricAlgorithm)
ModeValue ModeValue ModeValue ModeValue

表示对称算法中使用的密码模式。Represents the cipher mode used in the symmetric algorithm.

(Inherited from SymmetricAlgorithm)
PaddingValue PaddingValue PaddingValue PaddingValue

表示对称算法中使用的填充模式。Represents the padding mode used in the symmetric algorithm.

(Inherited from SymmetricAlgorithm)

显式界面实现

IDisposable.Dispose() IDisposable.Dispose() IDisposable.Dispose() IDisposable.Dispose()

释放由 SymmetricAlgorithm 占用的非托管资源,还可以另外再释放托管资源。Releases the unmanaged resources used by the SymmetricAlgorithm and optionally releases the managed resources.

(Inherited from SymmetricAlgorithm)

适用于