RSACng RSACng RSACng RSACng Class

定义

提供 RSA 的下一代加密技术 (CNG) 实现。Provides a Cryptography Next Generation (CNG) implementation of the RSA algorithm.

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

注解

RSACng类派生RSA自类。The RSACng class is derived from the RSA class. 因此,它不是的现有使用RSACryptoServiceProvider的下拉替换项。Therefore, it is not a drop-in replacement for existing uses of RSACryptoServiceProvider.

RSACng使用与ECDsaCng类(而不RSACryptoServiceProvider是类)相似的编程模型。RSACng uses a programming model that is similar to the ECDsaCng class rather than the RSACryptoServiceProvider class. 例如:For example:

  • 使用RSACng的键由单独CngKey的对象管理。The key used by RSACng is managed by a separate CngKey object. 与此相反RSACryptoServiceProvider ,有一个键直接绑定到类型本身的操作。In contrast, RSACryptoServiceProvider has a key that is directly tied to the operations of the type itself.

  • RSACng使用RSACng对象的属性执行此类操作,以便签名和验证签名,就像ECDsaCng使用其对象属性控制签名和验证操作一样。RSACng performs such operations as signing and verifying signatures by using properties of the RSACng object, just as ECDsaCng uses its object properties to control signing and verification operations.

备注

RSACng类是使用 windows CNG 库的 RSA 算法的实现,在 windows 以外的操作系统上不可用。The RSACng class is an implementation of the RSA algorithm using the Windows CNG libraries and isn't available on operating systems other than Windows. 对于不执行 Windows 互操作的应用程序,建议使用RSA.Create ,而不是直接引用此类型。For applications which aren't doing Windows interop, you're encouraged to use RSA.Create instead of referencing this type directly.

构造函数

RSACng() RSACng() RSACng() RSACng()

使用随机的 2,048 位密钥对初始化 RSACng 类的新实例。Initializes a new instance of the RSACng class with a random 2,048-bit key pair.

RSACng(CngKey) RSACng(CngKey) RSACng(CngKey) RSACng(CngKey)

使用指定的密钥初始化 RSACng 类的新实例。Initializes a new instance of the RSACng class with the specified key.

RSACng(Int32) RSACng(Int32) RSACng(Int32) RSACng(Int32)

使用具有指定大小的随机生成密钥初始化 RSACng 类的新实例。Initializes a new instance of the RSACng class with a randomly generated key of the specified size.

属性

Key Key Key Key

获取将由 RSACng 对象用于它执行的任何加密操作的密钥。Gets the key that will be used by the RSACng object for any cryptographic operation that it performs.

KeyExchangeAlgorithm KeyExchangeAlgorithm KeyExchangeAlgorithm KeyExchangeAlgorithm

获取可用于该 RSA 的实现的密钥交换算法的名称。Gets the name of the key exchange algorithm available with this implementation of RSA.

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
SignatureAlgorithm SignatureAlgorithm SignatureAlgorithm SignatureAlgorithm

获取可用于该 RSA 的实现的签名算法的名称。Gets the name of the signature algorithm available with this implementation of RSA.

方法

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

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

(Inherited from AsymmetricAlgorithm)
Decrypt(Byte[], RSAEncryptionPadding) Decrypt(Byte[], RSAEncryptionPadding) Decrypt(Byte[], RSAEncryptionPadding) Decrypt(Byte[], RSAEncryptionPadding)

使用指定填充模式对输入数据解密。Decrypts input data using the specified padding mode.

DecryptValue(Byte[]) DecryptValue(Byte[]) DecryptValue(Byte[]) DecryptValue(Byte[])

使用私钥对输入数据进行解密。Decrypts the input data using the private key.

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)
Encrypt(Byte[], RSAEncryptionPadding) Encrypt(Byte[], RSAEncryptionPadding) Encrypt(Byte[], RSAEncryptionPadding) Encrypt(Byte[], RSAEncryptionPadding)

使用指定的填充方式对输入数据进行加密。Encrypts the input data using the specified padding.

EncryptValue(Byte[]) EncryptValue(Byte[]) EncryptValue(Byte[]) EncryptValue(Byte[])

使用公钥对输入数据进行加密。Encrypts the input data using the public key.

Equals(Object) Equals(Object) Equals(Object) Equals(Object)

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

(Inherited from Object)
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)
ExportParameters(Boolean) ExportParameters(Boolean) ExportParameters(Boolean) ExportParameters(Boolean)

将 RSA 对象使用的密钥导出到 RSAParameters 对象中。Exports the key used by the RSA object into a RSAParameters object.

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

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

(Inherited from AsymmetricAlgorithm)
ExportRSAPrivateKey() ExportRSAPrivateKey() ExportRSAPrivateKey() ExportRSAPrivateKey()

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

(Inherited from RSA)
ExportRSAPublicKey() ExportRSAPublicKey() ExportRSAPublicKey() ExportRSAPublicKey()

以 PKCS#1 RSAPublicKey 格式导出当前密钥的公钥部分。Exports the public-key portion of the current key in the PKCS#1 RSAPublicKey format.

(Inherited from RSA)
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)

通过 XML 字符串中的密钥信息初始化 RSA 对象。Initializes an RSA object from the key information from an XML string.

(Inherited from RSA)
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 a specified portion of a byte array by using a specified hashing algorithm.

(Inherited from RSA)
HashData(Stream, HashAlgorithmName) HashData(Stream, HashAlgorithmName) HashData(Stream, HashAlgorithmName) HashData(Stream, HashAlgorithmName)

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

(Inherited from RSA)
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.

(Inherited from RSA)
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.

(Inherited from RSA)
ImportParameters(RSAParameters) ImportParameters(RSAParameters) ImportParameters(RSAParameters) ImportParameters(RSAParameters)

通过创建为参数结构创建新的 CngKey,来替换当前实例使用的现有密钥。Replaces the existing key that the current instance is working with by creating a new CngKey for the parameters structure.

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.

(Inherited from RSA)
ImportRSAPrivateKey(ReadOnlySpan<Byte>, Int32) ImportRSAPrivateKey(ReadOnlySpan<Byte>, Int32) ImportRSAPrivateKey(ReadOnlySpan<Byte>, Int32) ImportRSAPrivateKey(ReadOnlySpan<Byte>, Int32)

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

(Inherited from RSA)
ImportRSAPublicKey(ReadOnlySpan<Byte>, Int32) ImportRSAPublicKey(ReadOnlySpan<Byte>, Int32) ImportRSAPublicKey(ReadOnlySpan<Byte>, Int32) ImportRSAPublicKey(ReadOnlySpan<Byte>, Int32)

解密后,从 PKCS#1 RSAPublicKey 结构中导入公钥,以便替换此对象的密钥。Imports the public key from a PKCS#1 RSAPublicKey structure after decryption, replacing the keys for this object.

(Inherited from RSA)
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.

(Inherited from RSA)
MemberwiseClone() MemberwiseClone() MemberwiseClone() MemberwiseClone()

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

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

使用指定的哈希算法和填充模式计算指定字节的哈希值,并对生产的哈希值进行签名。Computes the hash value of the specified byte array using the specified hash algorithm and padding mode, and signs the resulting hash value.

(Inherited from RSA)
SignData(Byte[], Int32, Int32, HashAlgorithmName, RSASignaturePadding) SignData(Byte[], Int32, Int32, HashAlgorithmName, RSASignaturePadding) SignData(Byte[], Int32, Int32, HashAlgorithmName, RSASignaturePadding) SignData(Byte[], Int32, Int32, HashAlgorithmName, RSASignaturePadding)

使用指定的哈希算法和填充模式计算指定字节数组部分的哈希值并签名生成的哈希值。Computes the hash value of a portion of the specified byte array using the specified hash algorithm and padding mode, and signs the resulting hash value.

(Inherited from RSA)
SignData(Stream, HashAlgorithmName, RSASignaturePadding) SignData(Stream, HashAlgorithmName, RSASignaturePadding) SignData(Stream, HashAlgorithmName, RSASignaturePadding) SignData(Stream, HashAlgorithmName, RSASignaturePadding)

使用指定的哈希算法和填充模式计算指定流的哈希值并签名生成的哈希值。Computes the hash value of the specified stream using the specified hash algorithm and padding mode, and signs the resulting hash value.

(Inherited from RSA)
SignHash(Byte[], HashAlgorithmName, RSASignaturePadding) SignHash(Byte[], HashAlgorithmName, RSASignaturePadding) SignHash(Byte[], HashAlgorithmName, RSASignaturePadding) SignHash(Byte[], HashAlgorithmName, RSASignaturePadding)

对使用指定哈希算法和填充模式进行了哈希处理的数据进行签名。Signs data that was hashed by using the specified hashing algorithm and padding mode.

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

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

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

创建并返回包含当前 RSA 对象的密钥的 XML 字符串。Creates and returns an XML string containing the key of the current RSA object.

(Inherited from RSA)
TryDecrypt(ReadOnlySpan<Byte>, Span<Byte>, RSAEncryptionPadding, Int32) TryDecrypt(ReadOnlySpan<Byte>, Span<Byte>, RSAEncryptionPadding, Int32) TryDecrypt(ReadOnlySpan<Byte>, Span<Byte>, RSAEncryptionPadding, Int32) TryDecrypt(ReadOnlySpan<Byte>, Span<Byte>, RSAEncryptionPadding, Int32)

尝试使用私钥解密指定数据。Attempts to decrypt the specified data using the private key.

TryEncrypt(ReadOnlySpan<Byte>, Span<Byte>, RSAEncryptionPadding, Int32) TryEncrypt(ReadOnlySpan<Byte>, Span<Byte>, RSAEncryptionPadding, Int32) TryEncrypt(ReadOnlySpan<Byte>, Span<Byte>, RSAEncryptionPadding, Int32) TryEncrypt(ReadOnlySpan<Byte>, Span<Byte>, RSAEncryptionPadding, Int32)

尝试使用公钥加密指定数据。Attempts to encrypt the specified data using the public key.

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.

(Inherited from RSA)
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.

(Inherited from RSA)
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.

(Inherited from RSA)
TryExportRSAPrivateKey(Span<Byte>, Int32) TryExportRSAPrivateKey(Span<Byte>, Int32) TryExportRSAPrivateKey(Span<Byte>, Int32) TryExportRSAPrivateKey(Span<Byte>, Int32)

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

(Inherited from RSA)
TryExportRSAPublicKey(Span<Byte>, Int32) TryExportRSAPublicKey(Span<Byte>, Int32) TryExportRSAPublicKey(Span<Byte>, Int32) TryExportRSAPublicKey(Span<Byte>, Int32)

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

(Inherited from RSA)
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.

(Inherited from RSA)
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) Inherited from RSA
TrySignData(ReadOnlySpan<Byte>, Span<Byte>, HashAlgorithmName, RSASignaturePadding, Int32) TrySignData(ReadOnlySpan<Byte>, Span<Byte>, HashAlgorithmName, RSASignaturePadding, Int32) TrySignData(ReadOnlySpan<Byte>, Span<Byte>, HashAlgorithmName, RSASignaturePadding, Int32) TrySignData(ReadOnlySpan<Byte>, Span<Byte>, HashAlgorithmName, RSASignaturePadding, Int32) Inherited from RSA
TrySignHash(ReadOnlySpan<Byte>, Span<Byte>, HashAlgorithmName, RSASignaturePadding, Int32) TrySignHash(ReadOnlySpan<Byte>, Span<Byte>, HashAlgorithmName, RSASignaturePadding, Int32) TrySignHash(ReadOnlySpan<Byte>, Span<Byte>, HashAlgorithmName, RSASignaturePadding, Int32) TrySignHash(ReadOnlySpan<Byte>, Span<Byte>, HashAlgorithmName, RSASignaturePadding, Int32)
VerifyData(Byte[], Byte[], HashAlgorithmName, RSASignaturePadding) VerifyData(Byte[], Byte[], HashAlgorithmName, RSASignaturePadding) VerifyData(Byte[], Byte[], HashAlgorithmName, RSASignaturePadding) VerifyData(Byte[], Byte[], HashAlgorithmName, RSASignaturePadding)

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

(Inherited from RSA)
VerifyData(Byte[], Int32, Int32, Byte[], HashAlgorithmName, RSASignaturePadding) VerifyData(Byte[], Int32, Int32, Byte[], HashAlgorithmName, RSASignaturePadding) VerifyData(Byte[], Int32, Int32, Byte[], HashAlgorithmName, RSASignaturePadding) VerifyData(Byte[], Int32, Int32, Byte[], HashAlgorithmName, RSASignaturePadding)

通过使用指定的哈希算法和填充模式计算字节数组某部分中数据的哈希值,并将其与所提供的签名进行比较,以此验证数字签名是否有效。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 padding, and comparing it to the provided signature.

(Inherited from RSA)
VerifyData(ReadOnlySpan<Byte>, ReadOnlySpan<Byte>, HashAlgorithmName, RSASignaturePadding) VerifyData(ReadOnlySpan<Byte>, ReadOnlySpan<Byte>, HashAlgorithmName, RSASignaturePadding) VerifyData(ReadOnlySpan<Byte>, ReadOnlySpan<Byte>, HashAlgorithmName, RSASignaturePadding) VerifyData(ReadOnlySpan<Byte>, ReadOnlySpan<Byte>, HashAlgorithmName, RSASignaturePadding) Inherited from RSA
VerifyData(Stream, Byte[], HashAlgorithmName, RSASignaturePadding) VerifyData(Stream, Byte[], HashAlgorithmName, RSASignaturePadding) VerifyData(Stream, Byte[], HashAlgorithmName, RSASignaturePadding) VerifyData(Stream, Byte[], HashAlgorithmName, RSASignaturePadding)

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

(Inherited from RSA)
VerifyHash(Byte[], Byte[], HashAlgorithmName, RSASignaturePadding) VerifyHash(Byte[], Byte[], HashAlgorithmName, RSASignaturePadding) VerifyHash(Byte[], Byte[], HashAlgorithmName, RSASignaturePadding) VerifyHash(Byte[], Byte[], HashAlgorithmName, RSASignaturePadding)

验证已签名且已使用指定算法和填充模式进行哈希处理的数据。Verifies data that was signed and already hashed with the specified algorithm and padding mode.

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

字段

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)

适用于