DSACng 類別

定義

提供數位簽章演算法 (DSA) 的新一代密碼編譯 (CNG) 實作。Provides a Cryptography Next Generation (CNG) implementation of the Digital Signature Algorithm (DSA).

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 類別的新執行個體。Initializes a new instance of the DSACng class with a random 2,048-bit key pair.

DSACng(CngKey)

使用指定的金鑰,初始化 DSACng 類別的新執行個體。Initializes a new instance of the DSACng class with the specified key.

DSACng(Int32)

使用指定大小之隨機產生的金鑰,初始化 DSACng 類別的新執行個體。Initializes a new instance of the DSACng class with a randomly generated key of the specified size.

欄位

KeySizeValue

表示非對稱演算法使用的金鑰模數大小,以位元為單位。Represents the size, in bits, of the key modulus used by the asymmetric algorithm.

(繼承來源 AsymmetricAlgorithm)
LegalKeySizesValue

指定非對稱演算法所支援的金鑰大小。Specifies the key sizes that are supported by the asymmetric algorithm.

(繼承來源 AsymmetricAlgorithm)

屬性

Key

取得金鑰,DSACng 物件會將這個金鑰用於其所執行的任何密碼編譯作業。Gets the key that will be used by the DSACng object for any cryptographic operation that it performs.

KeyExchangeAlgorithm

取得金鑰交換演算法的名稱。Gets the name of the key exchange algorithm.

KeySize

取得或設定非對稱演算法使用的金鑰模數大小,以位元為單位。Gets or sets the size, in bits, of the key modulus used by the asymmetric algorithm.

(繼承來源 AsymmetricAlgorithm)
LegalKeySizes

取得 DSA 演算法支援的金鑰大小 (以位元為單位)。Gets the key sizes, in bits, that are supported by the DSA algorithm.

SignatureAlgorithm

取得簽章演算法的名稱。Gets the name of the signature algorithm.

方法

Clear()

釋放 AsymmetricAlgorithm 類別所使用的所有資源。Releases all resources used by the AsymmetricAlgorithm class.

(繼承來源 AsymmetricAlgorithm)
CreateSignature(Byte[])

建立指定資料的 DSA 簽章。Creates the DSA signature for the specified data.

CreateSignature(Byte[], DSASignatureFormat)

以指定的格式建立指定雜湊值的 DSA 簽章。Creates the DSA signature for the specified hash value in the indicated format.

(繼承來源 DSA)
CreateSignatureCore(ReadOnlySpan<Byte>, DSASignatureFormat)

以指定的格式建立指定雜湊值的 DSA 簽章。Creates the DSA signature for the specified hash value in the indicated format.

(繼承來源 DSA)
Dispose()

釋放 AsymmetricAlgorithm 類別目前的執行個體所使用的全部資源。Releases all resources used by the current instance of the AsymmetricAlgorithm class.

(繼承來源 AsymmetricAlgorithm)
Dispose(Boolean)

釋放 AsymmetricAlgorithm 類別所使用的 Unmanaged 資源,並選擇性地釋放 Managed 資源。Releases the unmanaged resources used by the AsymmetricAlgorithm class and optionally releases the managed resources.

(繼承來源 AsymmetricAlgorithm)
Equals(Object)

判斷指定的物件是否等於目前的物件。Determines whether the specified object is equal to the current object.

(繼承來源 Object)
ExportEncryptedPkcs8PrivateKey(ReadOnlySpan<Byte>, PbeParameters)

使用位元組型密碼以 PKCS#8 EncryptedPrivateKeyInfo 格式匯出目前金鑰。Exports the current key in the PKCS#8 EncryptedPrivateKeyInfo format with a byte-based password.

(繼承來源 AsymmetricAlgorithm)
ExportEncryptedPkcs8PrivateKey(ReadOnlySpan<Char>, PbeParameters)

使用 Char 型密碼以 PKCS#8 EncryptedPrivateKeyInfo 格式匯出目前金鑰。Exports the current key in the PKCS#8 EncryptedPrivateKeyInfo format with a char-based password.

(繼承來源 AsymmetricAlgorithm)
ExportParameters(Boolean)

匯出 DSA 演算法參數。Exports the DSA algorithm parameters.

ExportPkcs8PrivateKey()

以 PKCS#8 PrivateKeyInfo 格式匯出目前金鑰。Exports the current key in the PKCS#8 PrivateKeyInfo format.

(繼承來源 AsymmetricAlgorithm)
ExportSubjectPublicKeyInfo()

以 X.509 SubjectPublicKeyInfo 格式匯出目前金鑰的公開金鑰部分。Exports the public-key portion of the current key in the X.509 SubjectPublicKeyInfo format.

(繼承來源 AsymmetricAlgorithm)
FromXmlString(String)

從 XML 字串重新建構 DSA 物件。Reconstructs a DSA object from an XML string.

(繼承來源 DSA)
GetHashCode()

做為預設雜湊函式。Serves as the default hash function.

(繼承來源 Object)
GetMaxSignatureSize(DSASignatureFormat)

取得此索引鍵以指定格式所產生簽章的最大大小 (以位元組為單位)。Gets the largest size, in bytes, for a signature produced by this key in the indicated format.

(繼承來源 DSA)
GetType()

取得目前執行個體的 TypeGets the Type of the current instance.

(繼承來源 Object)
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.

(繼承來源 DSA)
HashData(Stream, HashAlgorithmName)

在衍生類別中覆寫時,會使用指定的雜湊演算法,來為指定的二進位資料流計算出雜湊值。When overridden in a derived class, computes the hash value of a specified binary stream by using a specified hashing algorithm.

(繼承來源 DSA)
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.

(繼承來源 DSA)
ImportEncryptedPkcs8PrivateKey(ReadOnlySpan<Char>, ReadOnlySpan<Byte>, Int32)

使用 Char 型密碼解密之後,從 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.

(繼承來源 DSA)
ImportFromEncryptedPem(ReadOnlySpan<Char>, ReadOnlySpan<Byte>)

匯入 RFC 7468 PEM 編碼的加密私密金鑰,並取代這個物件的金鑰。Imports an encrypted RFC 7468 PEM-encoded private key, replacing the keys for this object.

(繼承來源 DSA)
ImportFromEncryptedPem(ReadOnlySpan<Char>, ReadOnlySpan<Char>)

匯入 RFC 7468 PEM 編碼的加密私密金鑰,並取代這個物件的金鑰。Imports an encrypted RFC 7468 PEM-encoded private key, replacing the keys for this object.

(繼承來源 DSA)
ImportFromPem(ReadOnlySpan<Char>)

匯入 RFC 7468 PEM 編碼的金鑰,並取代這個物件的金鑰。Imports an RFC 7468 PEM-encoded key, replacing the keys for this object.

(繼承來源 DSA)
ImportParameters(DSAParameters)

為參數結構建立新的 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)

解密後,從 PKCS#8 PrivateKeyInfo 結構匯入公開/私密金鑰組,以取代這個物件的金鑰。Imports the public/private keypair from a PKCS#8 PrivateKeyInfo structure after decryption, replacing the keys for this object.

(繼承來源 DSA)
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.

(繼承來源 DSA)
MemberwiseClone()

建立目前 Object 的淺層複製。Creates a shallow copy of the current Object.

(繼承來源 Object)
SignData(Byte[], HashAlgorithmName)

使用指定的雜湊演算法,並簽署產生的雜湊值,來為指定的位元組陣列計算出雜湊值。Computes the hash value of the specified byte array using the specified hash algorithm and signs the resulting hash value.

(繼承來源 DSA)
SignData(Byte[], HashAlgorithmName, DSASignatureFormat)

計算指定資料的雜湊值,並使用指定的簽章格式進行簽署。Computes the hash value of the specified data and signs it using the specified signature format.

(繼承來源 DSA)
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.

(繼承來源 DSA)
SignData(Byte[], Int32, Int32, HashAlgorithmName, DSASignatureFormat)

計算指定資料的雜湊值,並使用指定的簽章格式進行簽署。Computes the hash value of the specified data and signs it using the specified signature format.

(繼承來源 DSA)
SignData(Stream, HashAlgorithmName)

使用指定的雜湊演算法,並簽署產生的雜湊值,來為指定的資料流計算出雜湊值。Computes the hash value of the specified stream using the specified hash algorithm and signs the resulting hash value.

(繼承來源 DSA)
SignData(Stream, HashAlgorithmName, DSASignatureFormat)

計算指定資料的雜湊值,並使用指定的簽章格式進行簽署。Computes the hash value of the specified data and signs it using the specified signature format.

(繼承來源 DSA)
SignDataCore(ReadOnlySpan<Byte>, HashAlgorithmName, DSASignatureFormat)

計算指定資料的雜湊值,並使用指定的簽章格式進行簽署。Computes the hash value of the specified data and signs it using the specified signature format.

(繼承來源 DSA)
SignDataCore(Stream, HashAlgorithmName, DSASignatureFormat)

計算指定資料的雜湊值,並使用指定的簽章格式進行簽署。Computes the hash value of the specified data and signs it using the specified signature format.

(繼承來源 DSA)
ToString()

傳回代表目前物件的字串。Returns a string that represents the current object.

(繼承來源 Object)
ToXmlString(Boolean)

建立並傳回表示目前 DSA 物件的 XML 字串。Creates and returns an XML string representation of the current DSA object.

(繼承來源 DSA)
TryCreateSignature(ReadOnlySpan<Byte>, Span<Byte>, DSASignatureFormat, Int32)

嘗試以指定的格式,建立指定雜湊值的 DSA 簽章,並放至提供的緩衝區。Attempts to create the DSA signature for the specified hash value in the indicated format and place it into the provided buffer.

(繼承來源 DSA)
TryCreateSignature(ReadOnlySpan<Byte>, Span<Byte>, Int32)

嘗試在所提供緩衝區中為指定的雜湊建立 DSA 簽章。Attempts to create the DSA signature for the specified hash into the provided buffer.

(繼承來源 DSA)
TryCreateSignatureCore(ReadOnlySpan<Byte>, Span<Byte>, DSASignatureFormat, Int32)

嘗試以指定的格式,建立指定雜湊值的 DSA 簽章,並放至提供的緩衝區。Attempts to create the DSA signature for the specified hash value in the indicated format and place it into the provided buffer.

(繼承來源 DSA)
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.

(繼承來源 DSA)
TryExportEncryptedPkcs8PrivateKey(ReadOnlySpan<Char>, PbeParameters, Span<Byte>, Int32)

使用 Char 型密碼,嘗試以 PKCS#8 EncryptedPrivateKeyInfo 格式將目前的金鑰匯出至提供的緩衝區。Attempts to export the current key in the PKCS#8 EncryptedPrivateKeyInfo format into a provided buffer, using a char-based password.

(繼承來源 DSA)
TryExportPkcs8PrivateKey(Span<Byte>, Int32)

嘗試以 PKCS#8 PrivateKeyInfo 格式將目前的金鑰匯出至提供的緩衝區。Attempts to export the current key in the PKCS#8 PrivateKeyInfo format into a provided buffer.

(繼承來源 DSA)
TryExportSubjectPublicKeyInfo(Span<Byte>, Int32)

嘗試以 X.509 SubjectPublicKeyInfo 格式將目前的金鑰匯出至提供的緩衝區。Attempts to export the current key in the X.509 SubjectPublicKeyInfo format into a provided buffer.

(繼承來源 DSA)
TryHashData(ReadOnlySpan<Byte>, Span<Byte>, HashAlgorithmName, Int32)

嘗試在所提供緩衝區中計算所提供資料的雜湊值。Attempts to compute the hash value of the provided data into a provided buffer.

(繼承來源 DSA)
TrySignData(ReadOnlySpan<Byte>, Span<Byte>, HashAlgorithmName, DSASignatureFormat, Int32)

嘗試以指定的格式,建立指定資料的 DSA 簽章,並放至提供的緩衝區。Attempts to create the DSA signature for the specified data in the indicated format and place it into the provided buffer.

(繼承來源 DSA)
TrySignData(ReadOnlySpan<Byte>, Span<Byte>, HashAlgorithmName, Int32)

嘗試在所提供緩衝區中為指定的資料建立 DSA 簽章。Attempts to create the DSA signature for the specified data into the provided buffer.

(繼承來源 DSA)
TrySignDataCore(ReadOnlySpan<Byte>, Span<Byte>, HashAlgorithmName, DSASignatureFormat, Int32)

嘗試以指定的格式,建立指定資料的 DSA 簽章,並放至提供的緩衝區。Attempts to create the DSA signature for the specified data in the indicated format and place it into the provided buffer.

(繼承來源 DSA)
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.

(繼承來源 DSA)
VerifyData(Byte[], Byte[], HashAlgorithmName, DSASignatureFormat)

驗證數位簽章對提供的資料是否有效。Verifies that a digital signature is valid for the provided data.

(繼承來源 DSA)
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.

(繼承來源 DSA)
VerifyData(Byte[], Int32, Int32, Byte[], HashAlgorithmName, DSASignatureFormat)

驗證數位簽章對提供的資料是否有效。Verifies that a digital signature is valid for the provided data.

(繼承來源 DSA)
VerifyData(ReadOnlySpan<Byte>, ReadOnlySpan<Byte>, HashAlgorithmName)

使用指定的雜湊演算法,並和提供的簽章比較,來為位元組範圍中的資料計算出雜湊值,藉此驗證數位簽章是否有效。Verifies that a digital signature is valid by calculating the hash value of the data in a byte span using the specified hash algorithm and comparing it to the provided signature.

(繼承來源 DSA)
VerifyData(ReadOnlySpan<Byte>, ReadOnlySpan<Byte>, HashAlgorithmName, DSASignatureFormat)

驗證數位簽章對提供的資料是否有效。Verifies that a digital signature is valid for the provided data.

(繼承來源 DSA)
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.

(繼承來源 DSA)
VerifyData(Stream, Byte[], HashAlgorithmName, DSASignatureFormat)

驗證數位簽章對提供的資料是否有效。Verifies that a digital signature is valid for the provided data.

(繼承來源 DSA)
VerifyDataCore(ReadOnlySpan<Byte>, ReadOnlySpan<Byte>, HashAlgorithmName, DSASignatureFormat)

驗證數位簽章對提供的資料是否有效。Verifies that a digital signature is valid for the provided data.

(繼承來源 DSA)
VerifyDataCore(Stream, ReadOnlySpan<Byte>, HashAlgorithmName, DSASignatureFormat)

驗證數位簽章對提供的資料是否有效。Verifies that a digital signature is valid for the provided data.

(繼承來源 DSA)
VerifySignature(Byte[], Byte[])

驗證所指定數位簽章是否符合指定的雜湊。Verifies if the specified digital signature matches the specified hash.

VerifySignature(Byte[], Byte[], DSASignatureFormat)

驗證數位簽章對提供的雜湊是否有效。Verifies that a digital signature is valid for the provided hash.

(繼承來源 DSA)
VerifySignature(ReadOnlySpan<Byte>, ReadOnlySpan<Byte>)

驗證數位簽章對提供的資料雜湊是否有效。Verifies that a digital signature is valid for a provided data hash.

(繼承來源 DSA)
VerifySignature(ReadOnlySpan<Byte>, ReadOnlySpan<Byte>, DSASignatureFormat)

驗證數位簽章對提供的雜湊是否有效。Verifies that a digital signature is valid for the provided hash.

(繼承來源 DSA)
VerifySignatureCore(ReadOnlySpan<Byte>, ReadOnlySpan<Byte>, DSASignatureFormat)

驗證數位簽章對提供的雜湊是否有效。Verifies that a digital signature is valid for the provided hash.

(繼承來源 DSA)

明確介面實作

IDisposable.Dispose()

此 API 支援此產品基礎結構,但無法直接用於程式碼之中。

如需這個成員的說明,請參閱 Dispose()For a description of this member, see Dispose().

(繼承來源 AsymmetricAlgorithm)

適用於