ECDsa ECDsa ECDsa ECDsa Class

定义

提供用于封装椭圆曲线数字签名算法 (ECDSA) 的抽象基类。Provides an abstract base class that encapsulates the Elliptic Curve Digital Signature Algorithm (ECDSA).

public ref class ECDsa abstract : System::Security::Cryptography::AsymmetricAlgorithm
public abstract class ECDsa : System.Security.Cryptography.AsymmetricAlgorithm
type ECDsa = class
    inherit AsymmetricAlgorithm
Public MustInherit Class ECDsa
Inherits AsymmetricAlgorithm
继承
派生

注解

此类用作ECDsaCng派生的抽象基类。This class serves as the abstract base class for ECDsaCng derivations.

构造函数

ECDsa() ECDsa() ECDsa() ECDsa()

初始化 ECDsa 类的新实例。Initializes a new instance of the ECDsa class.

属性

KeyExchangeAlgorithm KeyExchangeAlgorithm KeyExchangeAlgorithm KeyExchangeAlgorithm

获取密钥交换算法的名称。Gets the name of the key exchange algorithm.

KeySize KeySize KeySize KeySize

获取或设置非对称算法所用密钥模块的大小(以位为单位)。Gets or sets the size, in bits, of the key modulus used by the asymmetric algorithm.

(Inherited from AsymmetricAlgorithm)
LegalKeySizes LegalKeySizes LegalKeySizes LegalKeySizes

获取非对称算法支持的密钥大小。Gets the key sizes that are supported by the asymmetric algorithm.

(Inherited from AsymmetricAlgorithm)
SignatureAlgorithm SignatureAlgorithm SignatureAlgorithm SignatureAlgorithm

获取签名算法的名称。Gets the name of the signature algorithm.

方法

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

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

(Inherited from AsymmetricAlgorithm)
Create() Create() Create() Create()

创建椭圆曲线数字签名算法 (ECDSA) 的默认实现的一个新实例。Creates a new instance of the default implementation of the Elliptic Curve Digital Signature Algorithm (ECDSA).

Create(ECCurve) Create(ECCurve) Create(ECCurve) Create(ECCurve)

使用通过指定曲线新生成的密钥,创建椭圆曲线数字签名算法 (ECDSA) 的默认实现的新实例。Creates a new instance of the default implementation of the Elliptic Curve Digital Signature Algorithm (ECDSA) with a newly generated key over the specified curve.

Create(ECParameters) Create(ECParameters) Create(ECParameters) Create(ECParameters)

通过将指定参数用作密钥,创建椭圆曲线数字签名算法 (ECDSA) 的默认实现的新实例。Creates a new instance of the default implementation of the Elliptic Curve Digital Signature Algorithm (ECDSA) using the specified parameters as the key.

Create(String) Create(String) Create(String) Create(String)

创建椭圆曲线数字签名算法 (ECDSA) 的指定实现的一个新实例。Creates a new instance of the specified implementation of the Elliptic Curve Digital Signature Algorithm (ECDSA).

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

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

(Inherited from AsymmetricAlgorithm)
Dispose(Boolean) Dispose(Boolean) Dispose(Boolean) Dispose(Boolean)

释放 AsymmetricAlgorithm 类使用的非托管资源,并可以选择释放托管资源。Releases the unmanaged resources used by the AsymmetricAlgorithm class and optionally releases the managed resources.

(Inherited from AsymmetricAlgorithm)
Equals(Object) Equals(Object) Equals(Object) Equals(Object)

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

(Inherited from Object)
ExportECPrivateKey() ExportECPrivateKey() ExportECPrivateKey() ExportECPrivateKey()

以 ECPrivateKey 格式导出当前密钥。Exports the current key in the ECPrivateKey format.

ExportEncryptedPkcs8PrivateKey(ReadOnlySpan<Byte>, PbeParameters) ExportEncryptedPkcs8PrivateKey(ReadOnlySpan<Byte>, PbeParameters) ExportEncryptedPkcs8PrivateKey(ReadOnlySpan<Byte>, PbeParameters) ExportEncryptedPkcs8PrivateKey(ReadOnlySpan<Byte>, PbeParameters)

使用基于字节的密码以 PKCS#8 EncryptedPrivateKeyInfo 格式导出当前密钥。Exports the current key in the PKCS#8 EncryptedPrivateKeyInfo format with a byte-based password.

(Inherited from AsymmetricAlgorithm)
ExportEncryptedPkcs8PrivateKey(ReadOnlySpan<Char>, PbeParameters) ExportEncryptedPkcs8PrivateKey(ReadOnlySpan<Char>, PbeParameters) ExportEncryptedPkcs8PrivateKey(ReadOnlySpan<Char>, PbeParameters) ExportEncryptedPkcs8PrivateKey(ReadOnlySpan<Char>, PbeParameters)

使用基于字符的密码以 PKCS#8 EncryptedPrivateKeyInfo 格式导出当前密钥。Exports the current key in the PKCS#8 EncryptedPrivateKeyInfo format with a char-based password.

(Inherited from AsymmetricAlgorithm)
ExportExplicitParameters(Boolean) ExportExplicitParameters(Boolean) ExportExplicitParameters(Boolean) ExportExplicitParameters(Boolean)

在派生类中替代时,导出椭圆曲线的显式参数。When overridden in a derived class, exports the explicit parameters for an elliptic curve.

ExportParameters(Boolean) ExportParameters(Boolean) ExportParameters(Boolean) ExportParameters(Boolean)

在派生类中替代时,导出椭圆曲线的已命名或显式参数。When overridden in a derived class, exports the named or explicit parameters for an elliptic curve. 如果曲线具有一个名称,则 Curve 字段包含已命名的曲线参数,否则将包含显式参数。If the curve has a name, the Curve field contains named curve parameters, otherwise it contains explicit parameters.

ExportPkcs8PrivateKey() ExportPkcs8PrivateKey() ExportPkcs8PrivateKey() ExportPkcs8PrivateKey()

以 PKCS#8 PrivateKeyInfo 格式导出当前密钥。Exports the current key in the PKCS#8 PrivateKeyInfo format.

(Inherited from AsymmetricAlgorithm)
ExportSubjectPublicKeyInfo() ExportSubjectPublicKeyInfo() ExportSubjectPublicKeyInfo() ExportSubjectPublicKeyInfo()

以 X.509 SubjectPublicKeyInfo 格式导出当前密钥的公钥部分。Exports the public-key portion of the current key in the X.509 SubjectPublicKeyInfo format.

(Inherited from AsymmetricAlgorithm)
FromXmlString(String) FromXmlString(String) FromXmlString(String) FromXmlString(String)

在所有情况下均引发此方法。This method throws in all cases.

GenerateKey(ECCurve) GenerateKey(ECCurve) GenerateKey(ECCurve) GenerateKey(ECCurve)

在派生类中替代时,生成指定曲线的一个新公钥/私钥对。When overridden in a derived class, generates a new public/private key pair for the specified curve.

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)
HashData(Byte[], Int32, Int32, HashAlgorithmName) HashData(Byte[], Int32, Int32, HashAlgorithmName) HashData(Byte[], Int32, Int32, HashAlgorithmName) HashData(Byte[], Int32, Int32, HashAlgorithmName)

在派生类中进行重写后,通过使用指定的哈希算法计算字节数组指定部分的哈希值。When overridden in a derived class, computes the hash value of the specified portion of a byte array by using the specified hashing algorithm.

HashData(Stream, HashAlgorithmName) HashData(Stream, HashAlgorithmName) HashData(Stream, HashAlgorithmName) HashData(Stream, HashAlgorithmName)

在派生类中进行重写后,通过使用指定的哈希算法计算指定二进制流的哈希值。When overridden in a derived class, computes the hash value of the specified binary stream by using the specified hashing algorithm.

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

从 ECPrivateKey 结构中导入公共/私有密钥对,替换此对象的密钥。Imports the public/private keypair from an ECPrivateKey structure, replacing the keys for this object.

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

使用基于字节的密码解密之后,从 PKCS#8 EncryptedPrivateKeyInfo 结构中导入公/私钥对,以替换此对象的密钥。Imports the public/private keypair from a PKCS#8 EncryptedPrivateKeyInfo structure after decrypting with a byte-based password, replacing the keys for this object.

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

使用基于字符的密码解密之后,从 PKCS#8 EncryptedPrivateKeyInfo 结构中导入公/私钥对,以替换此对象的密钥。Imports the public/private keypair from a PKCS#8 EncryptedPrivateKeyInfo structure after decrypting with a char-based password, replacing the keys for this object.

ImportParameters(ECParameters) ImportParameters(ECParameters) ImportParameters(ECParameters) ImportParameters(ECParameters)

当在派生类中重写时,导入指定的参数。When overridden in a derived class, imports the specified parameters.

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

解密后,从 PKCS#8 PrivateKeyInfo 结构中导入公/私钥对,以替换此对象的密钥。Imports the public/private keypair from a PKCS#8 PrivateKeyInfo structure after decryption, replacing the keys for this object.

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

解密后,从 X.509 SubjectPublicKeyInfo 结构中导入公钥,以替换此对象的密钥。Imports the public key from an X.509 SubjectPublicKeyInfo structure after decryption, replacing the keys for this object.

MemberwiseClone() MemberwiseClone() MemberwiseClone() MemberwiseClone()

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

(Inherited from Object)
SignData(Byte[], HashAlgorithmName) SignData(Byte[], HashAlgorithmName) SignData(Byte[], HashAlgorithmName) SignData(Byte[], HashAlgorithmName)

使用指定的哈希算法计算指定字节数组的哈希值,并对生成的哈希值进行签名。Computes the hash value of the specified byte array using the specified hash algorithm and signs the resulting hash value.

SignData(Byte[], Int32, Int32, HashAlgorithmName) SignData(Byte[], Int32, Int32, HashAlgorithmName) SignData(Byte[], Int32, Int32, HashAlgorithmName) SignData(Byte[], Int32, Int32, HashAlgorithmName)

使用指定的哈希算法计算指定字节数组的一个部分的哈希值,并对生成的哈希值进行签名。Computes the hash value of a portion of the specified byte array using the specified hash algorithm and signs the resulting hash value.

SignData(Stream, HashAlgorithmName) SignData(Stream, HashAlgorithmName) SignData(Stream, HashAlgorithmName) SignData(Stream, HashAlgorithmName)

使用指定的哈希算法计算指定流的哈希值,并对生成的哈希值进行签名。Computes the hash value of the specified stream using the specified hash algorithm and signs the resulting hash value.

SignHash(Byte[]) SignHash(Byte[]) SignHash(Byte[]) SignHash(Byte[])

为指定的哈希值生成数字签名。Generates a digital signature for the specified hash value.

ToString() ToString() ToString() ToString()

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

(Inherited from Object)
ToXmlString(Boolean) ToXmlString(Boolean) ToXmlString(Boolean) ToXmlString(Boolean)

在所有情况下均引发此方法。This method throws in all cases.

TryExportECPrivateKey(Span<Byte>, Int32) TryExportECPrivateKey(Span<Byte>, Int32) TryExportECPrivateKey(Span<Byte>, Int32) TryExportECPrivateKey(Span<Byte>, Int32)

尝试以 ECPrivateKey 格式将当前密钥导入所提供的缓冲区。Attempts to export the current key in the ECPrivateKey format into a provided buffer.

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

尝试使用基于字节的密码以 PKCS#8 EncryptedPrivateKeyInfo 格式将当前密钥导出到所提供的缓冲区。Attempts to export the current key in the PKCS#8 EncryptedPrivateKeyInfo format into a provided buffer, using a byte-based password.

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

尝试使用基于字符的密码以 PKCS#8 EncryptedPrivateKeyInfo 格式将当前密钥导入所提供的缓冲区。Attempts to export the current key in the PKCS#8 EncryptedPrivateKeyInfo format into a provided buffer, using a char-based password.

TryExportPkcs8PrivateKey(Span<Byte>, Int32) TryExportPkcs8PrivateKey(Span<Byte>, Int32) TryExportPkcs8PrivateKey(Span<Byte>, Int32) TryExportPkcs8PrivateKey(Span<Byte>, Int32)

尝试以 PKCS#8 PrivateKeyInfo 格式将当前密钥导出到所提供的缓冲区。Attempts to export the current key in the PKCS#8 PrivateKeyInfo format into a provided buffer.

TryExportSubjectPublicKeyInfo(Span<Byte>, Int32) TryExportSubjectPublicKeyInfo(Span<Byte>, Int32) TryExportSubjectPublicKeyInfo(Span<Byte>, Int32) TryExportSubjectPublicKeyInfo(Span<Byte>, Int32)

尝试以 X.509 SubjectPublicKeyInfo 格式将当前密钥导出到所提供的缓冲区。Attempts to export the current key in the X.509 SubjectPublicKeyInfo format into a provided buffer.

TryHashData(ReadOnlySpan<Byte>, Span<Byte>, HashAlgorithmName, Int32) TryHashData(ReadOnlySpan<Byte>, Span<Byte>, HashAlgorithmName, Int32) TryHashData(ReadOnlySpan<Byte>, Span<Byte>, HashAlgorithmName, Int32) TryHashData(ReadOnlySpan<Byte>, Span<Byte>, HashAlgorithmName, Int32)
TrySignData(ReadOnlySpan<Byte>, Span<Byte>, HashAlgorithmName, Int32) TrySignData(ReadOnlySpan<Byte>, Span<Byte>, HashAlgorithmName, Int32) TrySignData(ReadOnlySpan<Byte>, Span<Byte>, HashAlgorithmName, Int32) TrySignData(ReadOnlySpan<Byte>, Span<Byte>, HashAlgorithmName, Int32)
TrySignHash(ReadOnlySpan<Byte>, Span<Byte>, Int32) TrySignHash(ReadOnlySpan<Byte>, Span<Byte>, Int32) TrySignHash(ReadOnlySpan<Byte>, Span<Byte>, Int32) TrySignHash(ReadOnlySpan<Byte>, Span<Byte>, Int32)
VerifyData(Byte[], Byte[], HashAlgorithmName) VerifyData(Byte[], Byte[], HashAlgorithmName) VerifyData(Byte[], Byte[], HashAlgorithmName) VerifyData(Byte[], Byte[], HashAlgorithmName)

通过使用指定的哈希算法计算指定数据的哈希值,并将其与提供的签名进行比较,验证数字签名是否有效。Verifies that a digital signature is valid by calculating the hash value of the specified data using the specified hash algorithm and comparing it to the provided signature.

VerifyData(Byte[], Int32, Int32, Byte[], HashAlgorithmName) VerifyData(Byte[], Int32, Int32, Byte[], HashAlgorithmName) VerifyData(Byte[], Int32, Int32, Byte[], HashAlgorithmName) VerifyData(Byte[], Int32, Int32, Byte[], HashAlgorithmName)

通过使用指定的哈希算法计算字节数组一个部分中数据的哈希值,并将其与提供的签名进行比较,验证数字签名是否有效。Verifies that a digital signature is valid by calculating the hash value of the data in a portion of a byte array using the specified hash algorithm and comparing it to the provided signature.

VerifyData(ReadOnlySpan<Byte>, ReadOnlySpan<Byte>, HashAlgorithmName) VerifyData(ReadOnlySpan<Byte>, ReadOnlySpan<Byte>, HashAlgorithmName) VerifyData(ReadOnlySpan<Byte>, ReadOnlySpan<Byte>, HashAlgorithmName) VerifyData(ReadOnlySpan<Byte>, ReadOnlySpan<Byte>, HashAlgorithmName)
VerifyData(Stream, Byte[], HashAlgorithmName) VerifyData(Stream, Byte[], HashAlgorithmName) VerifyData(Stream, Byte[], HashAlgorithmName) VerifyData(Stream, Byte[], HashAlgorithmName)

通过使用指定的哈希算法计算指定流的哈希值,并将其与提供的签名进行比较,验证数字签名是否有效。Verifies that a digital signature is valid by calculating the hash value of the specified stream using the specified hash algorithm and comparing it to the provided signature.

VerifyHash(Byte[], Byte[]) VerifyHash(Byte[], Byte[]) VerifyHash(Byte[], Byte[]) VerifyHash(Byte[], Byte[])

针对指定的哈希值验证数字签名。Verifies a digital signature against the specified hash value.

VerifyHash(ReadOnlySpan<Byte>, ReadOnlySpan<Byte>) VerifyHash(ReadOnlySpan<Byte>, ReadOnlySpan<Byte>) VerifyHash(ReadOnlySpan<Byte>, ReadOnlySpan<Byte>) VerifyHash(ReadOnlySpan<Byte>, ReadOnlySpan<Byte>)

字段

KeySizeValue KeySizeValue KeySizeValue KeySizeValue

表示非对称算法所用密钥模块的大小(以位为单位)。Represents the size, in bits, of the key modulus used by the asymmetric algorithm.

(Inherited from AsymmetricAlgorithm)
LegalKeySizesValue LegalKeySizesValue LegalKeySizesValue LegalKeySizesValue

指定非对称算法支持的密钥大小。Specifies the key sizes that are supported by the asymmetric algorithm.

(Inherited from AsymmetricAlgorithm)

显式界面实现

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

有关此成员的说明,请参见 Dispose()For a description of this member, see Dispose().

(Inherited from AsymmetricAlgorithm)

适用于