Share via


DSACryptoServiceProvider Class

[This documentation is for preview only, and is subject to change in later releases. Blank topics are included as placeholders.]

Defines a wrapper object to access the cryptographic service provider (CSP) implementation of the DSA algorithm. This class cannot be inherited.

Inheritance Hierarchy

System. . :: . .Object
  Microsoft.SPOT.Cryptoki. . :: . .SessionContainer
    System.Security.Cryptography. . :: . .AsymmetricAlgorithm
      System.Security.Cryptography..::..DSACryptoServiceProvider

Namespace:  System.Security.Cryptography
Assembly:  System.Security (in System.Security.dll)

Syntax

'Declaration
Public NotInheritable Class DSACryptoServiceProvider _
    Inherits AsymmetricAlgorithm
public sealed class DSACryptoServiceProvider : AsymmetricAlgorithm
public ref class DSACryptoServiceProvider sealed : public AsymmetricAlgorithm
[<Sealed>]
type DSACryptoServiceProvider =  
    class
        inherit AsymmetricAlgorithm
    end
public final class DSACryptoServiceProvider extends AsymmetricAlgorithm

The DSACryptoServiceProvider type exposes the following members.

Constructors

  Name Description
Public method DSACryptoServiceProvider(CryptoKey) Initializes a new instance of the DSACryptoServiceProvider class with the specified key.
Public method DSACryptoServiceProvider(Int32) Initializes a new instance of the DSACryptoServiceProvider class with the specified key size.
Public method DSACryptoServiceProvider(Session, Int32) Initializes a new instance of the DSACryptoServiceProvider class with the specified session and key size.
Public method DSACryptoServiceProvider(String, Int32) Initializes a new instance of the DSACryptoServiceProvider class with the specified service provider name and key size.

Top

Properties

  Name Description
Public property HashAlgorithm Gets or sets the hash algorithm to use when generating a signature for the data.
Public property IsDisposed (Inherited from SessionContainer.)
Public property KeyPair Gets or sets the CryptoKey object representing the key pair for the asymmetric algorithm. (Inherited from AsymmetricAlgorithm.)
Public property KeySize Gets or sets the size, in bits, of the key modulus used by the asymmetric algorithm. (Inherited from AsymmetricAlgorithm.)
Public property LegalKeySizes Gets the key sizes that are supported by the asymmetric algorithm. (Inherited from AsymmetricAlgorithm.)
Public property PublicOnly Gets a value that indicates whether the DSACryptoServiceProvider object contains only a public key.
Public property Session (Inherited from SessionContainer.)

Top

Methods

  Name Description
Public method Clear Releases all resources used by the AsymmetricAlgorithm class. (Inherited from AsymmetricAlgorithm.)
Public method CreateSignature Creates the DSA signature for the specified data.
Public method Dispose() () () () (Inherited from SessionContainer.)
Public method Equals(Object) Determines whether the specified Object is equal to the current Object. (Inherited from Object.)
Public method ExportParameters Exports the DSAParameters.
Public method GetHashCode Serves as a hash function for a particular type. (Inherited from Object.)
Public method GetType Gets the Type of the current instance. (Inherited from Object.)
Public method ImportParameters Imports the specified DSAParameters.
Public method SignData(array<Byte> [] () [] []) Computes the hash value of the specified byte array and signs the resulting hash value.
Public method SignData(Stream) Computes the hash value of the specified input stream and signs the resulting hash value.
Public method SignData(array<Byte> [] () [] [], Int32, Int32) Signs a byte array from the specified start point to the specified end point.
Public method SignHash Computes the signature for the specified hash value by encrypting it with the private key.
Public method ToString Returns a string that represents the current object. (Inherited from Object.)
Public method VerifyData Verifies the specified signature data by comparing it to the signature computed for the specified data.
Public method VerifyHash Verifies the specified signature data by comparing it to the signature computed for the specified hash value.
Public method VerifySignature Verifies the DSA signature for the specified data.

Top

Fields

  Name Description
Public fieldStatic member DefaultKeySize Specifies the size, in bits, to use for the key size if one is not provided.

Top

Remarks

You can use the DSACryptoServiceProvider class to create digital signatures and protect the integrity of your data.

To use a public-key system to digitally sign a message, the sender first applies a hash function to the message to create a message digest. The sender then encrypts the message digest with the sender's private key to create the sender's personal signature. Upon receiving the message and signature, the receiver decrypts the signature using the sender's public key to recover the message digest and hashes the message using the same hash algorithm that the sender used. If the message digest that the receiver computes exactly matches the message digest received from the sender, the receiver can be sure that the message was not altered while in transit. Note that a signature can be verified by anyone, because the sender's public key is common knowledge.

This algorithm supports key lengths from 512 bits to 1024 bits in increments of 64 bits.

Thread Safety

Any public static (Shared in Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.

See Also

Reference

System.Security.Cryptography Namespace