Share via


AsymmetricAlgorithm Class

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

Represents the abstract base class from which all implementations of asymmetric algorithms must inherit.

Inheritance Hierarchy

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

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

Syntax

'Declaration
Public MustInherit Class AsymmetricAlgorithm _
    Inherits SessionContainer
public abstract class AsymmetricAlgorithm : SessionContainer
public ref class AsymmetricAlgorithm abstract : public SessionContainer
[<AbstractClass>]
type AsymmetricAlgorithm =  
    class
        inherit SessionContainer
    end
public abstract class AsymmetricAlgorithm extends SessionContainer

The AsymmetricAlgorithm type exposes the following members.

Constructors

  Name Description
Protected method AsymmetricAlgorithm Initializes a new instance of the AsymmetricAlgorithm class.

Top

Properties

  Name Description
Public property IsDisposed (Inherited from SessionContainer.)
Public property KeyPair Gets or sets the CryptoKey object representing the key pair for the asymmetric algorithm.
Public property KeySize Gets or sets the size, in bits, of the key modulus used by the asymmetric algorithm.
Public property LegalKeySizes Gets the key sizes that are supported by the asymmetric algorithm.
Public property Session (Inherited from SessionContainer.)

Top

Methods

  Name Description
Public method Clear Releases all resources used by the AsymmetricAlgorithm class.
Public method Dispose() () () () (Inherited from SessionContainer.)
Protected method Dispose(Boolean) Releases the unmanaged resources used by the AsymmetricAlgorithm class and optionally releases the managed resources. (Overrides SessionContainer. . :: . .Dispose(Boolean).)
Public method Equals(Object) Determines whether the specified Object is equal to the current Object. (Inherited from Object.)
Protected method Finalize (Inherited from SessionContainer.)
Protected method GenerateKeyPair Generates a CryptoKey object representing the key pair for the symmetric algorithm.
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.)
Protected method MemberwiseClone Creates a shallow copy of the current Object. (Inherited from Object.)
Public method ToString Returns a string that represents the current object. (Inherited from Object.)

Top

Fields

  Name Description
Protected field KeyPairValue Specifies the CryptoKey object representing the key pair for the asymmetric algorithm.
Protected field KeySizeValue Represents the size, in bits, of the key modulus used by the asymmetric algorithm.
Protected field LegalKeySizesValue Specifies the key sizes that are supported by the asymmetric algorithm.
Protected field m_isDisposed (Inherited from SessionContainer.)
Protected field m_isSessionClosing (Inherited from SessionContainer.)
Protected field m_ownsSession (Inherited from SessionContainer.)
Protected field m_session (Inherited from SessionContainer.)
Protected field OwnsKeyPair Specifies whether the algorithm is responsible for disposing the key pair.

Top

Remarks

Asymmetric cryptographic algorithms, also known as public-key algorithms, require that both sender and receiver maintain a pair of related keys: a private key and a public key. Both keys are unique to the entity. The public key can be made available to anyone; this key is used for encoding data that is sent to a receiver. The private key must be kept private by the receiver; this key is used for decoding messages encoded using the receiver's public key. The RSACryptoServiceProvider class is an implementation of a public-key algorithm.

You can use public-key systems to form digital signatures. Digital signatures are used to help to protect the integrity of data. For example, 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 matches the message digest received from the sender, the receiver can assume that the message was not altered while in transit. Note that anyone can verify a signature, because the sender's public key is common knowledge. This technique does not retain the secrecy of the message; for the message to be secret, it must also be encrypted.

The DSACryptoServiceProvider class is an implementation of a digital signature algorithm. You can also use RSACryptoServiceProvider to create and verify a digital signature.

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