DSACng 类

定义

提供数字签名算法(DSA)的下一代加密(CNG)实现。

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

构造函数

名称 说明
DSACng()

使用随机 2,048 位密钥对初始化类的新实例 DSACng

DSACng(CngKey)

使用指定的键初始化类的新实例 DSACng

DSACng(Int32)

使用指定大小的随机生成的键初始化类的新实例 DSACng

字段

名称 说明
KeySizeValue

表示非对称算法使用的键模数的大小(以位为单位)。

(继承自 AsymmetricAlgorithm)
LegalKeySizesValue

指定非对称算法支持的密钥大小。

(继承自 AsymmetricAlgorithm)

属性

名称 说明
Key

获取对象将用于 DSACng 其执行的任何加密操作的密钥。

KeyExchangeAlgorithm

获取密钥交换算法的名称。

KeySize

获取或设置非对称算法使用的键模数的大小(以位为单位)。

(继承自 AsymmetricAlgorithm)
LegalKeySizes

获取 DSA 算法支持的密钥大小(以位为单位)。

SignatureAlgorithm

获取签名算法的名称。

方法

名称 说明
Clear()

释放类使用 AsymmetricAlgorithm 的所有资源。

(继承自 AsymmetricAlgorithm)
CreateSignature(Byte[], DSASignatureFormat)

以指示格式为指定的哈希值创建 DSA 签名。

(继承自 DSA)
CreateSignature(Byte[])

DSA为指定数据创建签名。

CreateSignatureCore(ReadOnlySpan<Byte>, DSASignatureFormat)

以指示格式为指定的哈希值创建 DSA 签名。

(继承自 DSA)
Dispose()

释放类的 AsymmetricAlgorithm 当前实例使用的所有资源。

(继承自 AsymmetricAlgorithm)
Dispose(Boolean)

释放类使用 AsymmetricAlgorithm 的非托管资源,并选择性地释放托管资源。

(继承自 AsymmetricAlgorithm)
Equals(Object)

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

(继承自 Object)
ExportEncryptedPkcs8PrivateKey(ReadOnlySpan<Byte>, PbeParameters)

使用基于字节的密码导出 PKCS#8 EncryptedPrivateKeyInfo 格式的当前密钥。

ExportEncryptedPkcs8PrivateKey(ReadOnlySpan<Byte>, PbeParameters)

使用基于字节的密码导出 PKCS#8 EncryptedPrivateKeyInfo 格式的当前密钥。

(继承自 AsymmetricAlgorithm)
ExportEncryptedPkcs8PrivateKey(ReadOnlySpan<Char>, PbeParameters)

使用基于字符的密码导出 PKCS#8 EncryptedPrivateKeyInfo 格式的当前密钥。

ExportEncryptedPkcs8PrivateKey(ReadOnlySpan<Char>, PbeParameters)

使用基于字符的密码导出 PKCS#8 EncryptedPrivateKeyInfo 格式的当前密钥。

(继承自 AsymmetricAlgorithm)
ExportEncryptedPkcs8PrivateKeyPem(ReadOnlySpan<Byte>, PbeParameters)

使用基于字节的密码 PEM 编码导出 PKCS#8 EncryptedPrivateKeyInfo 格式的当前密钥。

(继承自 AsymmetricAlgorithm)
ExportEncryptedPkcs8PrivateKeyPem(ReadOnlySpan<Char>, PbeParameters)

使用基于字符的密码 PEM 编码导出 PKCS#8 EncryptedPrivateKeyInfo 格式的当前密钥。

(继承自 AsymmetricAlgorithm)
ExportParameters(Boolean)

导出 DSA 算法参数。

ExportPkcs8PrivateKey()

导出 PKCS#8 PrivateKeyInfo 格式的当前密钥。

(继承自 AsymmetricAlgorithm)
ExportPkcs8PrivateKeyPem()

导出 PKCS#8 PrivateKeyInfo 格式的当前密钥(已编码 PEM)。

(继承自 AsymmetricAlgorithm)
ExportSubjectPublicKeyInfo()

以 X.509 SubjectPublicKeyInfo 格式导出当前密钥的公钥部分。

(继承自 AsymmetricAlgorithm)
ExportSubjectPublicKeyInfoPem()

以 X.509 SubjectPublicKeyInfo 格式(PEM 编码)导出当前密钥的公钥部分。

(继承自 AsymmetricAlgorithm)
FromXmlString(String)

DSA从 XML 字符串重新构造对象。

(继承自 DSA)
GetHashCode()

用作默认哈希函数。

(继承自 Object)
GetMaxSignatureSize(DSASignatureFormat)

获取此键以指示格式生成的签名的最大大小(以字节为单位)。

(继承自 DSA)
GetType()

获取当前实例的 Type

(继承自 Object)
HashData(Byte[], Int32, Int32, HashAlgorithmName)

在派生类中重写时,使用指定的哈希算法计算字节数组的指定部分的哈希值。

(继承自 DSA)
HashData(Stream, HashAlgorithmName)

在派生类中重写时,使用指定的哈希算法计算指定的二进制流的哈希值。

(继承自 DSA)
ImportEncryptedPkcs8PrivateKey(ReadOnlySpan<Byte>, ReadOnlySpan<Byte>, Int32)

使用基于字节的密码解密后,从 PKCS#8 EncryptedPrivateKeyInfo 结构导入公钥/私钥对,替换此对象的密钥。

ImportEncryptedPkcs8PrivateKey(ReadOnlySpan<Byte>, ReadOnlySpan<Byte>, Int32)

使用基于字节的密码解密后,从 PKCS#8 EncryptedPrivateKeyInfo 结构导入公钥/私钥对,替换此对象的密钥。

(继承自 DSA)
ImportEncryptedPkcs8PrivateKey(ReadOnlySpan<Char>, ReadOnlySpan<Byte>, Int32)

使用基于字符的密码解密后,从 PKCS#8 EncryptedPrivateKeyInfo 结构导入公钥/私钥对,替换此对象的密钥。

ImportEncryptedPkcs8PrivateKey(ReadOnlySpan<Char>, ReadOnlySpan<Byte>, Int32)

使用基于字符的密码解密后,从 PKCS#8 EncryptedPrivateKeyInfo 结构导入公钥/私钥对,替换此对象的密钥。

(继承自 DSA)
ImportFromEncryptedPem(ReadOnlySpan<Char>, ReadOnlySpan<Byte>)

导入加密的 RFC 7468 PEM 编码私钥,替换此对象的密钥。

(继承自 DSA)
ImportFromEncryptedPem(ReadOnlySpan<Char>, ReadOnlySpan<Char>)

导入加密的 RFC 7468 PEM 编码私钥,替换此对象的密钥。

(继承自 DSA)
ImportFromPem(ReadOnlySpan<Char>)

导入 RFC 7468 PEM 编码的密钥,替换此对象的密钥。

(继承自 DSA)
ImportParameters(DSAParameters)

通过为参数结构创建新 CngKey 项,替换当前实例正在使用的现有键。

ImportPkcs8PrivateKey(ReadOnlySpan<Byte>, Int32)

解密后,从 PKCS#8 PrivateKeyInfo 结构导入公钥/私钥对,替换此对象的密钥。

(继承自 DSA)
ImportSubjectPublicKeyInfo(ReadOnlySpan<Byte>, Int32)

解密后,从 X.509 SubjectPublicKeyInfo 结构导入公钥,替换此对象的密钥。

(继承自 DSA)
MemberwiseClone()

创建当前 Object的浅表副本。

(继承自 Object)
SignData(Byte[], HashAlgorithmName, DSASignatureFormat)

计算指定数据的哈希值,并使用指定的签名格式对其进行签名。

(继承自 DSA)
SignData(Byte[], HashAlgorithmName)

使用指定的哈希算法计算指定字节数组的哈希值,并对生成的哈希值进行签名。

(继承自 DSA)
SignData(Byte[], Int32, Int32, HashAlgorithmName, DSASignatureFormat)

计算指定数据的哈希值,并使用指定的签名格式对其进行签名。

(继承自 DSA)
SignData(Byte[], Int32, Int32, HashAlgorithmName)

使用指定的哈希算法计算指定字节数组的一部分的哈希值,并对生成的哈希值进行签名。

(继承自 DSA)
SignData(Stream, HashAlgorithmName, DSASignatureFormat)

计算指定数据的哈希值,并使用指定的签名格式对其进行签名。

(继承自 DSA)
SignData(Stream, HashAlgorithmName)

使用指定的哈希算法计算指定流的哈希值,并对生成的哈希值进行签名。

(继承自 DSA)
SignDataCore(ReadOnlySpan<Byte>, HashAlgorithmName, DSASignatureFormat)

计算指定数据的哈希值,并使用指定的签名格式对其进行签名。

(继承自 DSA)
SignDataCore(Stream, HashAlgorithmName, DSASignatureFormat)

计算指定数据的哈希值,并使用指定的签名格式对其进行签名。

(继承自 DSA)
ToString()

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

(继承自 Object)
ToXmlString(Boolean)

创建并返回当前 DSA 对象的 XML 字符串表示形式。

(继承自 DSA)
TryCreateSignature(ReadOnlySpan<Byte>, Span<Byte>, DSASignatureFormat, Int32)

尝试以指定格式为指定的哈希值创建 DSA 签名,并将其置于提供的缓冲区中。

(继承自 DSA)
TryCreateSignature(ReadOnlySpan<Byte>, Span<Byte>, Int32)

尝试为提供的缓冲区中的指定哈希创建 DSA 签名。

(继承自 DSA)
TryCreateSignatureCore(ReadOnlySpan<Byte>, Span<Byte>, DSASignatureFormat, Int32)

尝试以指定格式为指定的哈希值创建 DSA 签名,并将其置于提供的缓冲区中。

(继承自 DSA)
TryExportEncryptedPkcs8PrivateKey(ReadOnlySpan<Byte>, PbeParameters, Span<Byte>, Int32)

尝试使用基于字节的密码将 PKCS#8 EncryptedPrivateKeyInfo 格式中的当前密钥导出到提供的缓冲区中。

TryExportEncryptedPkcs8PrivateKey(ReadOnlySpan<Byte>, PbeParameters, Span<Byte>, Int32)

尝试使用基于字节的密码将 PKCS#8 EncryptedPrivateKeyInfo 格式中的当前密钥导出到提供的缓冲区中。

(继承自 DSA)
TryExportEncryptedPkcs8PrivateKey(ReadOnlySpan<Char>, PbeParameters, Span<Byte>, Int32)

尝试使用基于字符的密码将 PKCS#8 EncryptedPrivateKeyInfo 格式中的当前密钥导出到提供的缓冲区中。

TryExportEncryptedPkcs8PrivateKey(ReadOnlySpan<Char>, PbeParameters, Span<Byte>, Int32)

尝试使用基于字符的密码将 PKCS#8 EncryptedPrivateKeyInfo 格式中的当前密钥导出到提供的缓冲区中。

(继承自 DSA)
TryExportEncryptedPkcs8PrivateKeyPem(ReadOnlySpan<Byte>, PbeParameters, Span<Char>, Int32)

尝试使用基于字节的密码 PEM 编码导出 PKCS#8 EncryptedPrivateKeyInfo 格式的当前密钥。

(继承自 AsymmetricAlgorithm)
TryExportEncryptedPkcs8PrivateKeyPem(ReadOnlySpan<Char>, PbeParameters, Span<Char>, Int32)

使用基于字符的密码 PEM 编码导出 PKCS#8 EncryptedPrivateKeyInfo 格式的当前密钥。

(继承自 AsymmetricAlgorithm)
TryExportPkcs8PrivateKey(Span<Byte>, Int32)

尝试将 PKCS#8 PrivateKeyInfo 格式中的当前密钥导出到提供的缓冲区中。

TryExportPkcs8PrivateKey(Span<Byte>, Int32)

尝试将 PKCS#8 PrivateKeyInfo 格式中的当前密钥导出到提供的缓冲区中。

(继承自 DSA)
TryExportPkcs8PrivateKeyPem(Span<Char>, Int32)

尝试将 PEM 编码的 PKCS#8 PrivateKeyInfo 格式中的当前密钥导出到提供的缓冲区中。

(继承自 AsymmetricAlgorithm)
TryExportSubjectPublicKeyInfo(Span<Byte>, Int32)

尝试将 X.509 SubjectPublicKeyInfo 格式中的当前密钥导出到提供的缓冲区中。

(继承自 DSA)
TryExportSubjectPublicKeyInfoPem(Span<Char>, Int32)

尝试将 PEM 编码的 X.509 SubjectPublicKeyInfo 格式中的当前密钥导出到提供的缓冲区中。

(继承自 AsymmetricAlgorithm)
TryHashData(ReadOnlySpan<Byte>, Span<Byte>, HashAlgorithmName, Int32)

尝试将所提供的数据的哈希值计算到提供的缓冲区中。

(继承自 DSA)
TrySignData(ReadOnlySpan<Byte>, Span<Byte>, HashAlgorithmName, DSASignatureFormat, Int32)

尝试以指示的格式为指定数据创建 DSA 签名,并将其置于提供的缓冲区中。

(继承自 DSA)
TrySignData(ReadOnlySpan<Byte>, Span<Byte>, HashAlgorithmName, Int32)

尝试将指定数据的 DSA 签名创建到提供的缓冲区中。

(继承自 DSA)
TrySignDataCore(ReadOnlySpan<Byte>, Span<Byte>, HashAlgorithmName, DSASignatureFormat, Int32)

尝试以指示的格式为指定数据创建 DSA 签名,并将其置于提供的缓冲区中。

(继承自 DSA)
VerifyData(Byte[], Byte[], HashAlgorithmName, DSASignatureFormat)

验证数字签名是否对所提供的数据有效。

(继承自 DSA)
VerifyData(Byte[], Byte[], HashAlgorithmName)

通过使用指定的哈希算法计算指定数据的哈希值并将其与提供的签名进行比较,验证数字签名是否有效。

(继承自 DSA)
VerifyData(Byte[], Int32, Int32, Byte[], HashAlgorithmName, DSASignatureFormat)

验证数字签名是否对所提供的数据有效。

(继承自 DSA)
VerifyData(Byte[], Int32, Int32, Byte[], HashAlgorithmName)

通过使用指定的哈希算法计算字节数组中数据部分的哈希值并将其与提供的签名进行比较,验证数字签名是否有效。

(继承自 DSA)
VerifyData(ReadOnlySpan<Byte>, ReadOnlySpan<Byte>, HashAlgorithmName, DSASignatureFormat)

验证数字签名是否对所提供的数据有效。

(继承自 DSA)
VerifyData(ReadOnlySpan<Byte>, ReadOnlySpan<Byte>, HashAlgorithmName)

通过使用指定的哈希算法计算字节范围中数据的哈希值并将其与提供的签名进行比较,验证数字签名是否有效。

(继承自 DSA)
VerifyData(Stream, Byte[], HashAlgorithmName, DSASignatureFormat)

验证数字签名是否对所提供的数据有效。

(继承自 DSA)
VerifyData(Stream, Byte[], HashAlgorithmName)

通过使用指定的哈希算法计算指定流的哈希值并将其与提供的签名进行比较,验证数字签名是否有效。

(继承自 DSA)
VerifyDataCore(ReadOnlySpan<Byte>, ReadOnlySpan<Byte>, HashAlgorithmName, DSASignatureFormat)

验证数字签名是否对所提供的数据有效。

(继承自 DSA)
VerifyDataCore(Stream, ReadOnlySpan<Byte>, HashAlgorithmName, DSASignatureFormat)

验证数字签名是否对所提供的数据有效。

(继承自 DSA)
VerifySignature(Byte[], Byte[], DSASignatureFormat)

验证数字签名是否对提供的哈希有效。

(继承自 DSA)
VerifySignature(Byte[], Byte[])

验证指定的数字签名是否与指定的哈希匹配。

VerifySignature(ReadOnlySpan<Byte>, ReadOnlySpan<Byte>, DSASignatureFormat)

验证数字签名是否对提供的哈希有效。

(继承自 DSA)
VerifySignature(ReadOnlySpan<Byte>, ReadOnlySpan<Byte>)

验证数字签名是否对提供的数据哈希有效。

(继承自 DSA)
VerifySignatureCore(ReadOnlySpan<Byte>, ReadOnlySpan<Byte>, DSASignatureFormat)

验证数字签名是否对提供的哈希有效。

(继承自 DSA)

适用于