C# Class System.Security.Cryptography.DSACryptoServiceProvider

Inheritance: DSA, ICspAsymmetricAlgorithm
Afficher le fichier Open project: dotnet/corefx Class Usage Examples

Private Properties

Свойство Type Description
AcquireSafeProviderHandle System.Security.Cryptography.SafeProvHandle
DSACryptoServiceProvider System.Diagnostics
IsPublic bool

Méthodes publiques

Méthode Description
CreateSignature ( byte rgbHash ) : byte[]

Creates the DSA signature for the specified data.

DSACryptoServiceProvider ( ) : System.Diagnostics

Initializes a new instance of the DSACryptoServiceProvider class.

DSACryptoServiceProvider ( CspParameters parameters ) : System.Diagnostics

Initializes a new instance of the DSACryptoServiceProvider class with the specified parameters for the cryptographic service provider (CSP).

DSACryptoServiceProvider ( int dwKeySize ) : System.Diagnostics

Initializes a new instance of the DSACryptoServiceProvider class with the specified key size.

ExportCspBlob ( bool includePrivateParameters ) : byte[]

Exports a blob containing the key information associated with an DSACryptoServiceProvider object.

ExportParameters ( bool includePrivateParameters ) : DSAParameters
ImportCspBlob ( byte keyBlob ) : void

Imports a blob that represents DSA key information.

ImportParameters ( DSAParameters parameters ) : void
SignData ( Stream inputStream ) : byte[]

Computes the hash value of the specified input stream and signs the resulting hash value.

SignData ( byte buffer ) : byte[]

Computes the hash value of the specified input stream and signs the resulting hash value.

SignData ( byte buffer, int offset, int count ) : byte[]

Signs a byte array from the specified start point to the specified end point.

SignHash ( byte rgbHash, string str ) : byte[]

Computes the signature for the specified hash value by encrypting it with the private key.

VerifyData ( byte rgbData, byte rgbSignature ) : bool

Verifies the specified signature data by comparing it to the signature computed for the specified data.

VerifyHash ( byte rgbHash, string str, byte rgbSignature ) : bool

Verifies the specified signature data by comparing it to the signature computed for the specified hash value.

VerifySignature ( byte rgbHash, byte rgbSignature ) : bool

Méthodes protégées

Méthode Description
Dispose ( bool disposing ) : void
HashData ( Stream data, HashAlgorithmName hashAlgorithm ) : byte[]
HashData ( byte data, int offset, int count, HashAlgorithmName hashAlgorithm ) : byte[]

Private Methods

Méthode Description
AcquireSafeProviderHandle ( ) : System.Security.Cryptography.SafeProvHandle

This method helps Acquire the default CSP and avoids the need for static SafeProvHandle in CapiHelper class

DSACryptoServiceProvider ( int dwKeySize, CspParameters parameters ) : System.Diagnostics
IsPublic ( byte keyBlob ) : bool

Find whether a DSS key blob is public.

Method Details

CreateSignature() public méthode

Creates the DSA signature for the specified data.
public CreateSignature ( byte rgbHash ) : byte[]
rgbHash byte The data to be signed.
Résultat byte[]

DSACryptoServiceProvider() public méthode

Initializes a new instance of the DSACryptoServiceProvider class.
public DSACryptoServiceProvider ( ) : System.Diagnostics
Résultat System.Diagnostics

DSACryptoServiceProvider() public méthode

Initializes a new instance of the DSACryptoServiceProvider class with the specified parameters for the cryptographic service provider (CSP).
public DSACryptoServiceProvider ( CspParameters parameters ) : System.Diagnostics
parameters CspParameters The parameters for the CSP.
Résultat System.Diagnostics

DSACryptoServiceProvider() public méthode

Initializes a new instance of the DSACryptoServiceProvider class with the specified key size.
public DSACryptoServiceProvider ( int dwKeySize ) : System.Diagnostics
dwKeySize int The size of the key for the asymmetric algorithm in bits.
Résultat System.Diagnostics

Dispose() protected méthode

protected Dispose ( bool disposing ) : void
disposing bool
Résultat void

ExportCspBlob() public méthode

Exports a blob containing the key information associated with an DSACryptoServiceProvider object.
public ExportCspBlob ( bool includePrivateParameters ) : byte[]
includePrivateParameters bool
Résultat byte[]

ExportParameters() public méthode

public ExportParameters ( bool includePrivateParameters ) : DSAParameters
includePrivateParameters bool
Résultat DSAParameters

HashData() protected méthode

protected HashData ( Stream data, HashAlgorithmName hashAlgorithm ) : byte[]
data Stream
hashAlgorithm HashAlgorithmName
Résultat byte[]

HashData() protected méthode

protected HashData ( byte data, int offset, int count, HashAlgorithmName hashAlgorithm ) : byte[]
data byte
offset int
count int
hashAlgorithm HashAlgorithmName
Résultat byte[]

ImportCspBlob() public méthode

Imports a blob that represents DSA key information.
public ImportCspBlob ( byte keyBlob ) : void
keyBlob byte A byte array that represents a DSA key blob.
Résultat void

ImportParameters() public méthode

public ImportParameters ( DSAParameters parameters ) : void
parameters DSAParameters
Résultat void

SignData() public méthode

Computes the hash value of the specified input stream and signs the resulting hash value.
public SignData ( Stream inputStream ) : byte[]
inputStream Stream The input data for which to compute the hash.
Résultat byte[]

SignData() public méthode

Computes the hash value of the specified input stream and signs the resulting hash value.
public SignData ( byte buffer ) : byte[]
buffer byte The input data for which to compute the hash.
Résultat byte[]

SignData() public méthode

Signs a byte array from the specified start point to the specified end point.
public SignData ( byte buffer, int offset, int count ) : byte[]
buffer byte The input data to sign.
offset int The offset into the array from which to begin using data.
count int The number of bytes in the array to use as data.
Résultat byte[]

SignHash() public méthode

Computes the signature for the specified hash value by encrypting it with the private key.
public SignHash ( byte rgbHash, string str ) : byte[]
rgbHash byte The hash value of the data to be signed.
str string The name of the hash algorithm used to create the hash value of the data.
Résultat byte[]

VerifyData() public méthode

Verifies the specified signature data by comparing it to the signature computed for the specified data.
public VerifyData ( byte rgbData, byte rgbSignature ) : bool
rgbData byte The data that was signed.
rgbSignature byte The signature data to be verified.
Résultat bool

VerifyHash() public méthode

Verifies the specified signature data by comparing it to the signature computed for the specified hash value.
public VerifyHash ( byte rgbHash, string str, byte rgbSignature ) : bool
rgbHash byte The hash value of the data to be signed.
str string The name of the hash algorithm used to create the hash value of the data.
rgbSignature byte The signature data to be verified.
Résultat bool

VerifySignature() public méthode

public VerifySignature ( byte rgbHash, byte rgbSignature ) : bool
rgbHash byte
rgbSignature byte
Résultat bool