RSACryptoServiceProvider

RSACryptoServiceProvider


Provides RSA encryption services using the Windows Crypto API methods.


Implements:

AsymmetricAlgorithm 
ICspAsymmetricAlgorithm 
IObject 
RSA 

Public:

Properties:

NameDescription
 CspKeyContainerInfo (get) Returns a CspKeyContainerInfo object containing information about this RSACryptoServiceProvider instance.  
 KeyExchangeAlgorithm (get) Returns the name of the key exchange algorithm this instance represents.  
 KeySize (get) Returns the RSA key size in bits.  
 KeySize (let) Sets the key size.  
 LegalKeySizes (get) Returns an array of KeySizes objects defining the valid key sizes.  
 PersistKeyInCsp (get) Returns if the current key will be stored in the current provider container.  
 PersistKeyInCsp (let) Sets if the current key will be stored in the current provider container.  
 PublicOnly (get) Returns if the key for this RSA instance is only the public half of the key pair.  
 SignatureAlgorithm (get) Returns the signature algorithm.  

Methods:

NameDescription
 Clear Releases any resources and disposes the RSA instance.  
 Decrypt Decrypts data using the private key in this RSA instance.  
 DecryptValue Decrypts the value.  
 Encrypt Encrypts data using the public key in this RSA instance.  
 EncryptValue Encrypts a value.  
 Equals This function determines if the value passed in is the same as the current object instance. Meaning, are the Value and this object the same object in memory.  
 ExportCspBlob Exports the key information as a CryptoAPI PRIVATEKEYBLOB or PUBLICKEYBLOB structure.  
 ExportParameters Exports the RSA algorithm parameters.  
 FromXmlString Imports RSA parameters from an XML string.  
 GetHashCode Returns a psuedo-unique number used to help identify this object in memory. The current method is to return the value obtained from ObjPtr. If a different method needs to be impelmented then change the method here in this function.

An override might be necessary if the hashcode should be derived from a value contained within the class.  

 ImportCspBlob Imports a CryptoAPI PRIVATEKEYBLOB or PUBLICKEYBLOB into the RSA provider.  
 ImportParameters Imports the RSA key parameters.  
 SignData Signs data using the specified hash algorithm.  
 SignHash Signs a hash using RSA AT_SIGNATURE.  
 ToString Returns a string representation of this object instance. The default method simply returns the application name and class name in which this class resides.

A Person class may return the persons name instead.  

 ToXmlString Exports the RSA key to an Xml string.  
 VerifyData Verifies the data using the signature.  
 VerifyHash Verifies the hash using the signature.  

See Also

Project CorLib Overview

Class RSACryptoServiceProvider Overview