Поделиться через


AsymmetricAlgorithm Class

Microsoft Silverlight will reach end of support after October 2021. Learn more.

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

Inheritance Hierarchy

System.Object
  System.Security.Cryptography.AsymmetricAlgorithm
    System.Security.Cryptography.RSA

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

Syntax

'Declaration
<ComVisibleAttribute(True)> _
Public MustInherit Class AsymmetricAlgorithm _
    Implements IDisposable
[ComVisibleAttribute(true)]
public abstract class AsymmetricAlgorithm : IDisposable

The AsymmetricAlgorithm type exposes the following members.

Constructors

  Name Description
Protected methodSupported by Silverlight for Windows Phone AsymmetricAlgorithm Initializes a new instance of the AsymmetricAlgorithm class.

Top

Properties

  Name Description
Public propertySupported by Silverlight for Windows Phone KeyExchangeAlgorithm When overridden in a derived class, gets the name of the key exchange algorithm.
Public propertySupported by Silverlight for Windows Phone KeySize Gets or sets the size, in bits, of the key modulus used by the asymmetric algorithm.
Public propertySupported by Silverlight for Windows Phone LegalKeySizes Gets the key sizes that are supported by the asymmetric algorithm.
Public propertySupported by Silverlight for Windows Phone SignatureAlgorithm Gets the name of the signature algorithm.

Top

Methods

  Name Description
Public methodSupported by Silverlight for Windows Phone Clear Releases all resources used by the AsymmetricAlgorithm class.
Public methodStatic memberSupported by Silverlight for Windows Phone Create() Creates a default cryptographic object used to perform the asymmetric algorithm.
Public methodStatic memberSupported by Silverlight for Windows Phone Create(String) Creates an instance of the specified implementation of an asymmetric algorithm.
Public methodSupported by Silverlight for Windows Phone Dispose() Releases all resources used by the current instance of the AsymmetricAlgorithm class.
Protected methodSupported by Silverlight for Windows Phone Dispose(Boolean) Releases the unmanaged resources used by the AsymmetricAlgorithm class and optionally releases the managed resources.
Public methodSupported by Silverlight for Windows Phone Equals(Object) Determines whether the specified Object is equal to the current Object. (Inherited from Object.)
Protected methodSupported by Silverlight for Windows Phone Finalize Allows an object to try to free resources and perform other cleanup operations before the Object is reclaimed by garbage collection. (Inherited from Object.)
Public methodSupported by Silverlight for Windows Phone FromXmlString When overridden in a derived class, reconstructs an AsymmetricAlgorithm object from an XML string.
Public methodSupported by Silverlight for Windows Phone GetHashCode Serves as a hash function for a particular type. (Inherited from Object.)
Public methodSupported by Silverlight for Windows Phone GetType Gets the Type of the current instance. (Inherited from Object.)
Protected methodSupported by Silverlight for Windows Phone MemberwiseClone Creates a shallow copy of the current Object. (Inherited from Object.)
Public methodSupported by Silverlight for Windows Phone ToString Returns a string that represents the current object. (Inherited from Object.)
Public methodSupported by Silverlight for Windows Phone ToXmlString When overridden in a derived class, creates and returns an XML string representation of the current AsymmetricAlgorithm object.

Top

Fields

  Name Description
Protected fieldSupported by Silverlight for Windows Phone KeySizeValue Represents the size, in bits, of the key modulus used by the asymmetric algorithm.
Protected fieldSupported by Silverlight for Windows Phone LegalKeySizesValue Specifies the key sizes that are supported by the asymmetric algorithm.

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 RSACryptoServiceProvider class is an implementation of a digital signature algorithm.

The System.Security.Cryptography namespace provides base classes for RSA only.

Version Information

Silverlight for Windows Phone

Supported in: Windows Phone OS 7.1

Platforms

For a list of the operating systems and browsers that are supported by Silverlight, see Supported Operating Systems and Browsers.

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.