RSACryptoServiceProvider Class

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

Performs asymmetric encryption and decryption using the implementation of the RSA algorithm provided by the cryptographic service provider (CSP).

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

public ref class RSACryptoServiceProvider sealed : public AsymmetricAlgorithm

The RSACryptoServiceProvider type exposes the following members.

  NameDescription
Public methodRSACryptoServiceProvider(CryptoKey)Initializes a new instance of the RSACryptoServiceProvider class with the specified key.
Public methodRSACryptoServiceProvider(Int32)Initializes a new instance of the RSACryptoServiceProvider class with the specified key size.
Public methodRSACryptoServiceProvider(Session, Int32)Initializes a new instance of the RSACryptoServiceProvider class with the specified session context and key size.
Public methodRSACryptoServiceProvider(String, Int32)Initializes a new instance of the RSACryptoServiceProvider class with the specified service provider and key size.
Top

  NameDescription
Public propertyEncryptionMechanismGets or sets the RSA encryption mechanism.
Public propertyHashAlgorithmGets or sets the hash algorithm to use when generating a signature for the data.
Public propertyIsDisposed (Inherited from SessionContainer.)
Public propertyKeyPairGets or sets the CryptoKey object representing the key pair for the asymmetric algorithm. (Inherited from AsymmetricAlgorithm.)
Public propertyKeySizeGets or sets the size, in bits, of the key modulus used by the asymmetric algorithm. (Inherited from AsymmetricAlgorithm.)
Public propertyLegalKeySizesGets the key sizes that are supported by the asymmetric algorithm. (Inherited from AsymmetricAlgorithm.)
Public propertyPublicOnlyGets a value that indicates whether the RSACryptoServiceProvider object contains only a public key.
Public propertySession (Inherited from SessionContainer.)
Top

  NameDescription
Public methodClearReleases all resources used by the AsymmetricAlgorithm class. (Inherited from AsymmetricAlgorithm.)
Public methodDecryptDecrypts data with the RSA algorithm.
Public methodDispose()()()() (Inherited from SessionContainer.)
Public methodEncryptEncrypts data with the RSA algorithm.
Public methodEquals(Object)Determines whether the specified Object is equal to the current Object. (Inherited from Object.)
Public methodExportParametersExports the RSAParameters.
Public methodGetHashCodeServes as a hash function for a particular type. (Inherited from Object.)
Public methodGetTypeGets the Type of the current instance. (Inherited from Object.)
Public methodImportParametersImports the specified RSAParameters.
Public methodSignData(array<Byte>[]()[][])Computes the hash value of the specified byte array and signs the resulting hash value.
Public methodSignData(Stream)Computes the hash value of the specified input stream, and signs the resulting hash value.
Public methodSignData(array<Byte>[]()[][], HashAlgorithm)Computes the hash value of the specified byte array using the specified hash algorithm, and signs the resulting hash value.
Public methodSignData(Stream, HashAlgorithm)Computes the hash value of the specified input stream using the specified hash algorithm, and signs the resulting hash value.
Public methodSignData(array<Byte>[]()[][], Int32, Int32, HashAlgorithm)Computes the hash value of a subset of the specified byte array using the specified hash algorithm, and signs the resulting hash value.
Public methodSignHashComputes the signature for the specified hash value by encrypting it with the private key.
Public methodToStringReturns a string that represents the current object. (Inherited from Object.)
Public methodVerifyData(array<Byte>[]()[][], array<Byte>[]()[][])Verifies that a digital signature is valid by determining the hash value in the signature and comparing it to the hash value of the provided data.
Public methodVerifyData(array<Byte>[]()[][], HashAlgorithm, array<Byte>[]()[][])Verifies that a digital signature is valid by determining the hash value in the signature using the provided public key and comparing it to the hash value of the provided data.
Public methodVerifyHashVerifies that a digital signature is valid by determining the hash value in the signature using the provided public key and comparing it to the provided hash value.
Top

  NameDescription
Public fieldStatic memberDefaultKeySizeRepresents the key size to use if one is not provided. By default, contains a value of 1024 bits.
Top

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