Share via


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).

Inheritance Hierarchy

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

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

Syntax

'Declaration
Public NotInheritable Class RSACryptoServiceProvider _
    Inherits AsymmetricAlgorithm
public sealed class RSACryptoServiceProvider : AsymmetricAlgorithm
public ref class RSACryptoServiceProvider sealed : public AsymmetricAlgorithm
[<Sealed>]
type RSACryptoServiceProvider =  
    class
        inherit AsymmetricAlgorithm
    end
public final class RSACryptoServiceProvider extends AsymmetricAlgorithm

The RSACryptoServiceProvider type exposes the following members.

Constructors

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

Top

Properties

  Name Description
Public property EncryptionMechanism Gets or sets the RSA encryption mechanism.
Public property HashAlgorithm Gets or sets the hash algorithm to use when generating a signature for the data.
Public property IsDisposed (Inherited from SessionContainer.)
Public property KeyPair Gets or sets the CryptoKey object representing the key pair for the asymmetric algorithm. (Inherited from AsymmetricAlgorithm.)
Public property KeySize Gets or sets the size, in bits, of the key modulus used by the asymmetric algorithm. (Inherited from AsymmetricAlgorithm.)
Public property LegalKeySizes Gets the key sizes that are supported by the asymmetric algorithm. (Inherited from AsymmetricAlgorithm.)
Public property PublicOnly Gets a value that indicates whether the RSACryptoServiceProvider object contains only a public key.
Public property Session (Inherited from SessionContainer.)

Top

Methods

  Name Description
Public method Clear Releases all resources used by the AsymmetricAlgorithm class. (Inherited from AsymmetricAlgorithm.)
Public method Decrypt Decrypts data with the RSA algorithm.
Public method Dispose() () () () (Inherited from SessionContainer.)
Public method Encrypt Encrypts data with the RSA algorithm.
Public method Equals(Object) Determines whether the specified Object is equal to the current Object. (Inherited from Object.)
Public method ExportParameters Exports the RSAParameters.
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.)
Public method ImportParameters Imports the specified RSAParameters.
Public method SignData(array<Byte> [] () [] []) Computes the hash value of the specified byte array and signs the resulting hash value.
Public method SignData(Stream) Computes the hash value of the specified input stream, and signs the resulting hash value.
Public method SignData(array<Byte> [] () [] [], HashAlgorithm) Computes the hash value of the specified byte array using the specified hash algorithm, and signs the resulting hash value.
Public method SignData(Stream, HashAlgorithm) Computes the hash value of the specified input stream using the specified hash algorithm, and signs the resulting hash value.
Public method SignData(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 method SignHash Computes the signature for the specified hash value by encrypting it with the private key.
Public method ToString Returns a string that represents the current object. (Inherited from Object.)
Public method VerifyData(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 method VerifyData(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 method VerifyHash 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 provided hash value.

Top

Fields

  Name Description
Public fieldStatic member DefaultKeySize Represents the key size to use if one is not provided. By default, contains a value of 1024 bits.

Top

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