Represents the abstract base class from which all implementations of asymmetric algorithms must inherit.
Assembly: mscorlib (in mscorlib.dll)
Thetype exposes the following members.
|KeyExchangeAlgorithm||When overridden in a derived class, gets the name of the key exchange algorithm.|
|KeySize||Gets or sets the size, in bits, of the key modulus used by the asymmetric algorithm.|
|LegalKeySizes||Gets the key sizes that are supported by the asymmetric algorithm.|
|SignatureAlgorithm||Gets the name of the signature algorithm.|
|Clear||Releases all resources used by the class.|
|Create()||Creates a default cryptographic object used to perform the asymmetric algorithm.|
|Create(String)||Creates an instance of the specified implementation of an asymmetric algorithm.|
|Dispose()||Releases all resources used by the current instance of the class.|
|Dispose(Boolean)||Releases the unmanaged resources used by the class and optionally releases the managed resources.|
|Equals(Object)||Determines whether the specified object is equal to the current object. (Inherited from Object.)|
|Finalize||Allows an object to try to free resources and perform other cleanup operations before it is reclaimed by garbage collection. (Inherited from Object.)|
|FromXmlString||When overridden in a derived class, reconstructs an object from an XML string.|
|GetHashCode||Serves as the default hash function. (Inherited from Object.)|
|GetType||Gets the Type of the current instance. (Inherited from Object.)|
|MemberwiseClone||Creates a shallow copy of the current Object. (Inherited from Object.)|
|ToString||Returns a string that represents the current object. (Inherited from Object.)|
|ToXmlString||When overridden in a derived class, creates and returns an XML string representation of the current object.|
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. For an in-depth discussion of public-key encryption and algorithms, see the "Public-Key Encryption" section in Cryptographic Services. For information about how to use the Srong Name tool (Sn.exe) to create key pairs, see How to: Create a Public/Private Key Pair.
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.
To learn how to use the RSA algorithm to encrypt and decrypt XML data, and create and verify XML digital signatures, see these articles:
The following code example demonstrates how to implement a custom asymmetric algorithm inherited from the class. An additional class is provided to demonstrate how to use the custom class.
Here's an additional class that demonstrates how to use the custom class.
Windows 8.1, Windows Server 2012 R2, Windows 8, Windows Server 2012, Windows 7, Windows Vista SP2, Windows Server 2008 (Server Core Role not supported), Windows Server 2008 R2 (Server Core Role supported with SP1 or later; Itanium not supported)
The .NET Framework does not support all versions of every platform. For a list of the supported versions, see .NET Framework System Requirements.