C# Класс System.Security.Cryptography.DSACryptoServiceProvider

Наследование: DSA, ICspAsymmetricAlgorithm
Показать файл Открыть проект Примеры использования класса

Private Properties

Свойство Тип Описание
AcquireSafeProviderHandle System.Security.Cryptography.SafeProvHandle
DSACryptoServiceProvider System.Diagnostics
IsPublic bool

Открытые методы

Метод Описание
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

Защищенные методы

Метод Описание
Dispose ( bool disposing ) : void
HashData ( Stream data, HashAlgorithmName hashAlgorithm ) : byte[]
HashData ( byte data, int offset, int count, HashAlgorithmName hashAlgorithm ) : byte[]

Приватные методы

Метод Описание
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.

Описание методов

CreateSignature() публичный Метод

Creates the DSA signature for the specified data.
public CreateSignature ( byte rgbHash ) : byte[]
rgbHash byte The data to be signed.
Результат byte[]

DSACryptoServiceProvider() публичный Метод

Initializes a new instance of the DSACryptoServiceProvider class.
public DSACryptoServiceProvider ( ) : System.Diagnostics
Результат System.Diagnostics

DSACryptoServiceProvider() публичный Метод

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.
Результат System.Diagnostics

DSACryptoServiceProvider() публичный Метод

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.
Результат System.Diagnostics

Dispose() защищенный Метод

protected Dispose ( bool disposing ) : void
disposing bool
Результат void

ExportCspBlob() публичный Метод

Exports a blob containing the key information associated with an DSACryptoServiceProvider object.
public ExportCspBlob ( bool includePrivateParameters ) : byte[]
includePrivateParameters bool
Результат byte[]

ExportParameters() публичный Метод

public ExportParameters ( bool includePrivateParameters ) : DSAParameters
includePrivateParameters bool
Результат DSAParameters

HashData() защищенный Метод

protected HashData ( Stream data, HashAlgorithmName hashAlgorithm ) : byte[]
data Stream
hashAlgorithm HashAlgorithmName
Результат byte[]

HashData() защищенный Метод

protected HashData ( byte data, int offset, int count, HashAlgorithmName hashAlgorithm ) : byte[]
data byte
offset int
count int
hashAlgorithm HashAlgorithmName
Результат byte[]

ImportCspBlob() публичный Метод

Imports a blob that represents DSA key information.
public ImportCspBlob ( byte keyBlob ) : void
keyBlob byte A byte array that represents a DSA key blob.
Результат void

ImportParameters() публичный Метод

public ImportParameters ( DSAParameters parameters ) : void
parameters DSAParameters
Результат void

SignData() публичный Метод

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.
Результат byte[]

SignData() публичный Метод

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.
Результат byte[]

SignData() публичный Метод

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.
Результат byte[]

SignHash() публичный Метод

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.
Результат byte[]

VerifyData() публичный Метод

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.
Результат bool

VerifyHash() публичный Метод

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.
Результат bool

VerifySignature() публичный Метод

public VerifySignature ( byte rgbHash, byte rgbSignature ) : bool
rgbHash byte
rgbSignature byte
Результат bool