RSACryptoServiceProvider RSACryptoServiceProvider RSACryptoServiceProvider RSACryptoServiceProvider Class

Definice

Asymetrické šifrování a dešifrování provádění pomocí provádí RSA algoritmus poskytované zprostředkovateli kryptografických služeb (CSP).Performs asymmetric encryption and decryption using the implementation of the RSA algorithm provided by the cryptographic service provider (CSP). Tato třída nemůže dědit.This class cannot be inherited.

public ref class RSACryptoServiceProvider sealed : System::Security::Cryptography::RSA, System::Security::Cryptography::ICspAsymmetricAlgorithm
[System.Runtime.InteropServices.ComVisible(true)]
public sealed class RSACryptoServiceProvider : System.Security.Cryptography.RSA, System.Security.Cryptography.ICspAsymmetricAlgorithm
type RSACryptoServiceProvider = class
    inherit RSA
    interface ICspAsymmetricAlgorithm
Public NotInheritable Class RSACryptoServiceProvider
Inherits RSA
Implements ICspAsymmetricAlgorithm
Dědičnost
RSACryptoServiceProviderRSACryptoServiceProviderRSACryptoServiceProviderRSACryptoServiceProvider
Atributy
Implementuje

Příklady

Následující příklad kódu používá RSACryptoServiceProvider třídy zašifrovat řetězec do pole bajtů a dešifrovat bajty zpět do řetězce.The following code example uses the RSACryptoServiceProvider class to encrypt a string into an array of bytes and then decrypt the bytes back into a string.

using namespace System;
using namespace System::Security::Cryptography;
using namespace System::Text;
array<Byte>^ RSAEncrypt( array<Byte>^DataToEncrypt, RSAParameters RSAKeyInfo, bool DoOAEPPadding )
{
   try
   {
      
      //Create a new instance of RSACryptoServiceProvider.
      RSACryptoServiceProvider^ RSA = gcnew RSACryptoServiceProvider;
      
      //Import the RSA Key information. This only needs
      //toinclude the public key information.
      RSA->ImportParameters( RSAKeyInfo );
      
      //Encrypt the passed byte array and specify OAEP padding.  
      //OAEP padding is only available on Microsoft Windows XP or
      //later.  

      array<Byte>^encryptedData = RSA->Encrypt( DataToEncrypt, DoOAEPPadding );
	  delete RSA;
	  return encryptedData;
   }
   //Catch and display a CryptographicException  
   //to the console.
   catch ( CryptographicException^ e ) 
   {
      Console::WriteLine( e->Message );
      return nullptr;
   }

}

array<Byte>^ RSADecrypt( array<Byte>^DataToDecrypt, RSAParameters RSAKeyInfo, bool DoOAEPPadding )
{
   try
   {
      
      //Create a new instance of RSACryptoServiceProvider.
      RSACryptoServiceProvider^ RSA = gcnew RSACryptoServiceProvider;
      
      //Import the RSA Key information. This needs
      //to include the private key information.
      RSA->ImportParameters( RSAKeyInfo );
      
      //Decrypt the passed byte array and specify OAEP padding.  
      //OAEP padding is only available on Microsoft Windows XP or
      //later.  
	  
      array<Byte>^decryptedData = RSA->Decrypt( DataToDecrypt, DoOAEPPadding );
      delete RSA;
	  return decryptedData;
   }
   //Catch and display a CryptographicException  
   //to the console.
   catch ( CryptographicException^ e ) 
   {
      Console::WriteLine( e );
      return nullptr;
   }

}

int main()
{
   try
   {
      
      //Create a UnicodeEncoder to convert between byte array and string.
      UnicodeEncoding^ ByteConverter = gcnew UnicodeEncoding;
      
      //Create byte arrays to hold original, encrypted, and decrypted data.
      array<Byte>^dataToEncrypt = ByteConverter->GetBytes( "Data to Encrypt" );
      array<Byte>^encryptedData;
      array<Byte>^decryptedData;
      
      //Create a new instance of RSACryptoServiceProvider to generate
      //public and private key data.
      RSACryptoServiceProvider^ RSA = gcnew RSACryptoServiceProvider;
      
      //Pass the data to ENCRYPT, the public key information 
      //(using RSACryptoServiceProvider.ExportParameters(false),
      //and a boolean flag specifying no OAEP padding.
      encryptedData = RSAEncrypt( dataToEncrypt, RSA->ExportParameters( false ), false );
      
      //Pass the data to DECRYPT, the private key information 
      //(using RSACryptoServiceProvider.ExportParameters(true),
      //and a boolean flag specifying no OAEP padding.
      decryptedData = RSADecrypt( encryptedData, RSA->ExportParameters( true ), false );
      
      //Display the decrypted plaintext to the console. 
      Console::WriteLine( "Decrypted plaintext: {0}", ByteConverter->GetString( decryptedData ) );
	  delete RSA;
   }
   catch ( ArgumentNullException^ ) 
   {
      
      //Catch this exception in case the encryption did
      //not succeed.
      Console::WriteLine( "Encryption failed." );
   }

}

using System;
using System.Security.Cryptography;
using System.Text;

class RSACSPSample
{

    static void Main()
    {
        try
        {
            //Create a UnicodeEncoder to convert between byte array and string.
            UnicodeEncoding ByteConverter = new UnicodeEncoding();

            //Create byte arrays to hold original, encrypted, and decrypted data.
            byte[] dataToEncrypt = ByteConverter.GetBytes("Data to Encrypt");
            byte[] encryptedData;
            byte[] decryptedData;

            //Create a new instance of RSACryptoServiceProvider to generate
            //public and private key data.
            using (RSACryptoServiceProvider RSA = new RSACryptoServiceProvider())
            {

                //Pass the data to ENCRYPT, the public key information 
                //(using RSACryptoServiceProvider.ExportParameters(false),
                //and a boolean flag specifying no OAEP padding.
                encryptedData = RSAEncrypt(dataToEncrypt, RSA.ExportParameters(false), false);

                //Pass the data to DECRYPT, the private key information 
                //(using RSACryptoServiceProvider.ExportParameters(true),
                //and a boolean flag specifying no OAEP padding.
                decryptedData = RSADecrypt(encryptedData, RSA.ExportParameters(true), false);

                //Display the decrypted plaintext to the console. 
                Console.WriteLine("Decrypted plaintext: {0}", ByteConverter.GetString(decryptedData));
            }
        }
        catch (ArgumentNullException)
        {
            //Catch this exception in case the encryption did
            //not succeed.
            Console.WriteLine("Encryption failed.");

        }
    }

    public static byte[] RSAEncrypt(byte[] DataToEncrypt, RSAParameters RSAKeyInfo, bool DoOAEPPadding)
    {
        try
        {
            byte[] encryptedData;
            //Create a new instance of RSACryptoServiceProvider.
            using (RSACryptoServiceProvider RSA = new RSACryptoServiceProvider())
            {

                //Import the RSA Key information. This only needs
                //toinclude the public key information.
                RSA.ImportParameters(RSAKeyInfo);

                //Encrypt the passed byte array and specify OAEP padding.  
                //OAEP padding is only available on Microsoft Windows XP or
                //later.  
                encryptedData = RSA.Encrypt(DataToEncrypt, DoOAEPPadding);
            }
            return encryptedData;
        }
        //Catch and display a CryptographicException  
        //to the console.
        catch (CryptographicException e)
        {
            Console.WriteLine(e.Message);

            return null;
        }

    }

    public static byte[] RSADecrypt(byte[] DataToDecrypt, RSAParameters RSAKeyInfo, bool DoOAEPPadding)
    {
        try
        {
            byte[] decryptedData;
            //Create a new instance of RSACryptoServiceProvider.
            using (RSACryptoServiceProvider RSA = new RSACryptoServiceProvider())
            {
                //Import the RSA Key information. This needs
                //to include the private key information.
                RSA.ImportParameters(RSAKeyInfo);

                //Decrypt the passed byte array and specify OAEP padding.  
                //OAEP padding is only available on Microsoft Windows XP or
                //later.  
                decryptedData = RSA.Decrypt(DataToDecrypt, DoOAEPPadding);
            }
            return decryptedData;
        }
        //Catch and display a CryptographicException  
        //to the console.
        catch (CryptographicException e)
        {
            Console.WriteLine(e.ToString());

            return null;
        }

    }
}
Imports System
Imports System.Security.Cryptography
Imports System.Text

 _

Class RSACSPSample


    Shared Sub Main()
        Try
            'Create a UnicodeEncoder to convert between byte array and string.
            Dim ByteConverter As New UnicodeEncoding()

            'Create byte arrays to hold original, encrypted, and decrypted data.
            Dim dataToEncrypt As Byte() = ByteConverter.GetBytes("Data to Encrypt")
            Dim encryptedData() As Byte
            Dim decryptedData() As Byte

            'Create a new instance of RSACryptoServiceProvider to generate
            'public and private key data.
            Using RSA As New RSACryptoServiceProvider

                'Pass the data to ENCRYPT, the public key information 
                '(using RSACryptoServiceProvider.ExportParameters(false),
                'and a boolean flag specifying no OAEP padding.
                encryptedData = RSAEncrypt(dataToEncrypt, RSA.ExportParameters(False), False)

                'Pass the data to DECRYPT, the private key information 
                '(using RSACryptoServiceProvider.ExportParameters(true),
                'and a boolean flag specifying no OAEP padding.
                decryptedData = RSADecrypt(encryptedData, RSA.ExportParameters(True), False)

                'Display the decrypted plaintext to the console. 
                Console.WriteLine("Decrypted plaintext: {0}", ByteConverter.GetString(decryptedData))
            End Using
        Catch e As ArgumentNullException
            'Catch this exception in case the encryption did
            'not succeed.
            Console.WriteLine("Encryption failed.")
        End Try
    End Sub


    Public Shared Function RSAEncrypt(ByVal DataToEncrypt() As Byte, ByVal RSAKeyInfo As RSAParameters, ByVal DoOAEPPadding As Boolean) As Byte()
        Try
            Dim encryptedData() As Byte
            'Create a new instance of RSACryptoServiceProvider.
            Using RSA As New RSACryptoServiceProvider

                'Import the RSA Key information. This only needs
                'toinclude the public key information.
                RSA.ImportParameters(RSAKeyInfo)

                'Encrypt the passed byte array and specify OAEP padding.  
                'OAEP padding is only available on Microsoft Windows XP or
                'later.  
                encryptedData = RSA.Encrypt(DataToEncrypt, DoOAEPPadding)
            End Using
            Return encryptedData
            'Catch and display a CryptographicException  
            'to the console.
        Catch e As CryptographicException
            Console.WriteLine(e.Message)

            Return Nothing
        End Try
    End Function


    Public Shared Function RSADecrypt(ByVal DataToDecrypt() As Byte, ByVal RSAKeyInfo As RSAParameters, ByVal DoOAEPPadding As Boolean) As Byte()
        Try
            Dim decryptedData() As Byte
            'Create a new instance of RSACryptoServiceProvider.
            Using RSA As New RSACryptoServiceProvider
                'Import the RSA Key information. This needs
                'to include the private key information.
                RSA.ImportParameters(RSAKeyInfo)

                'Decrypt the passed byte array and specify OAEP padding.  
                'OAEP padding is only available on Microsoft Windows XP or
                'later.  
                decryptedData = RSA.Decrypt(DataToDecrypt, DoOAEPPadding)
                'Catch and display a CryptographicException  
                'to the console.
            End Using
            Return decryptedData
        Catch e As CryptographicException
            Console.WriteLine(e.ToString())

            Return Nothing
        End Try
    End Function
End Class

Následující příklad exportuje informace o klíči vytvořené pomocí RSACryptoServiceProvider do RSAParameters objektu.The following code example exports the key information created using the RSACryptoServiceProvider into an RSAParameters object.

try
{
   //Create a new RSACryptoServiceProvider Object*.
   RSACryptoServiceProvider^ RSA = gcnew RSACryptoServiceProvider;
   
   //Export the key information to an RSAParameters object.
   //Pass false to export the public key information or pass
   //true to export public and private key information.
   RSAParameters RSAParams = RSA->ExportParameters( false );
}
catch ( CryptographicException^ e ) 
{
   //Catch this exception in case the encryption did
   //not succeed.
   Console::WriteLine( e->Message );
}
try
{
    //Create a new RSACryptoServiceProvider object.
    using (RSACryptoServiceProvider RSA = new RSACryptoServiceProvider())
    {


        //Export the key information to an RSAParameters object.
        //Pass false to export the public key information or pass
        //true to export public and private key information.
        RSAParameters RSAParams = RSA.ExportParameters(false);
    }


}
catch (CryptographicException e)
{
    //Catch this exception in case the encryption did
    //not succeed.
    Console.WriteLine(e.Message);

}
     Try

         'Create a new RSACryptoServiceProvider object. 
         Dim RSA As New RSACryptoServiceProvider()

         'Export the key information to an RSAParameters object.
'Pass false to export the public key information or pass
'true to export public and private key information.
         Dim RSAParams As RSAParameters = RSA.ExportParameters(False)


     Catch e As CryptographicException
         'Catch this exception in case the encryption did
         'not succeed.
         Console.WriteLine(e.Message)
     End Try

Poznámky

Toto je výchozí implementace RSA.This is the default implementation of RSA.

RSACryptoServiceProvider Podporuje velikosti klíčů od 384 do 16384 bitů v krocích po 8 bitech, pokud máte Vylepšený zprostředkovatel kryptografických služeb Microsoft nainstalována.The RSACryptoServiceProvider supports key sizes from 384 bits to 16384 bits in increments of 8 bits if you have the Microsoft Enhanced Cryptographic Provider installed. Podporuje velikosti klíčů od 384 do 512 bitů v krocích po 8 bitech, pokud máte základní zprostředkovatel kryptografických služeb Microsoft nainstalována.It supports key sizes from 384 bits to 512 bits in increments of 8 bits if you have the Microsoft Base Cryptographic Provider installed.

Platná velikost klíče jsou závislé na zprostředkovatele kryptografických služeb (CSP), který je používán RSACryptoServiceProvider instance.Valid key sizes are dependent on the cryptographic service provider (CSP) that is used by the RSACryptoServiceProvider instance. Povolit zprostředkovatele kryptografických služeb Windows klíčů velikosti 384 do 16384 bitů pro verzích Windows starších než Windows 8.1Windows 8.1a klíč velikosti 512 do 16384 bitů pro Windows 8.1Windows 8.1.Windows CSPs enable keys sizes of 384 to 16384 bits for Windows versions prior to Windows 8.1Windows 8.1, and key sizes of 512 to 16384 bits for Windows 8.1Windows 8.1. Další informace najdete v tématu CryptGenKey funkce v dokumentaci k Windows.For more information, see CryptGenKey function in the Windows documentation.

Interoperabilita s rozhraním Microsoft Cryptographic API (CAPI)Interoperation with the Microsoft Cryptographic API (CAPI)

Na rozdíl od implementace RSA v nespravované CAPI RSACryptoServiceProvider třídy obrátí pořadí šifrované pole bajtů, šifrování a dešifrování.Unlike the RSA implementation in unmanaged CAPI, the RSACryptoServiceProvider class reverses the order of an encrypted array of bytes after encryption and before decryption. Ve výchozím nastavení, šifrují data RSACryptoServiceProvider třída není možné dešifrovat pomocí CAPI CryptDecrypt funkce a data zašifrovaná pomocí CAPI CryptEncrypt metoda není možné dešifrovat pomocí RSACryptoServiceProvider třídy.By default, data encrypted by the RSACryptoServiceProvider class cannot be decrypted by the CAPI CryptDecrypt function and data encrypted by the CAPI CryptEncrypt method cannot be decrypted by the RSACryptoServiceProvider class.

Pokud není kompenzovat opačného pořadí při vzájemné spolupráci mezi rozhraním API, RSACryptoServiceProvider třídy vyvolá výjimku CryptographicException.If you do not compensate for the reverse ordering when interoperating between APIs, the RSACryptoServiceProvider class throws a CryptographicException.

Pro spolupráci s CAPI, musíte ručně změnit pořadí šifrovaných bajtů před šifrovaná data spolupracuje s jinému rozhraní API.To interoperate with CAPI, you must manually reverse the order of encrypted bytes before the encrypted data interoperates with another API. Můžete snadno změnit pořadí spravované bajtového pole pomocí volání Array.Reverse metody.You can easily reverse the order of a managed byte array by calling the Array.Reverse method.

Konstruktory

RSACryptoServiceProvider() RSACryptoServiceProvider() RSACryptoServiceProvider() RSACryptoServiceProvider()

Inicializuje novou instanci třídy RSACryptoServiceProvider pomocí výchozí klíč.Initializes a new instance of the RSACryptoServiceProvider class using the default key.

RSACryptoServiceProvider(CspParameters) RSACryptoServiceProvider(CspParameters) RSACryptoServiceProvider(CspParameters) RSACryptoServiceProvider(CspParameters)

Inicializuje novou instanci třídy RSACryptoServiceProvider třídy se zadanými parametry.Initializes a new instance of the RSACryptoServiceProvider class with the specified parameters.

RSACryptoServiceProvider(Int32) RSACryptoServiceProvider(Int32) RSACryptoServiceProvider(Int32) RSACryptoServiceProvider(Int32)

Inicializuje novou instanci třídy RSACryptoServiceProvider třída s atributem velikost určeného klíče.Initializes a new instance of the RSACryptoServiceProvider class with the specified key size.

RSACryptoServiceProvider(Int32, CspParameters) RSACryptoServiceProvider(Int32, CspParameters) RSACryptoServiceProvider(Int32, CspParameters) RSACryptoServiceProvider(Int32, CspParameters)

Inicializuje novou instanci třídy RSACryptoServiceProvider třídy s parametry a velikost určeného klíče.Initializes a new instance of the RSACryptoServiceProvider class with the specified key size and parameters.

Vlastnosti

CspKeyContainerInfo CspKeyContainerInfo CspKeyContainerInfo CspKeyContainerInfo

Získá CspKeyContainerInfo objekt, který popisuje další informace o pár kryptografických klíčů.Gets a CspKeyContainerInfo object that describes additional information about a cryptographic key pair.

KeyExchangeAlgorithm KeyExchangeAlgorithm KeyExchangeAlgorithm KeyExchangeAlgorithm

Získá název algoritmus výměny klíčů, který je k dispozici s touto implementací RSA.Gets the name of the key exchange algorithm available with this implementation of RSA.

KeySize KeySize KeySize KeySize

Získá velikost aktuálního klíče.Gets the size of the current key.

LegalKeySizes LegalKeySizes LegalKeySizes LegalKeySizes
PersistKeyInCsp PersistKeyInCsp PersistKeyInCsp PersistKeyInCsp

Získá nebo nastaví hodnotu určující, zda klíč by měl nastavit jako trvalý ve zprostředkovateli kryptografických služeb (CSP).Gets or sets a value indicating whether the key should be persisted in the cryptographic service provider (CSP).

PublicOnly PublicOnly PublicOnly PublicOnly

Získá hodnotu určující, zda RSACryptoServiceProvider objekt obsahuje pouze veřejný klíč.Gets a value that indicates whether the RSACryptoServiceProvider object contains only a public key.

SignatureAlgorithm SignatureAlgorithm SignatureAlgorithm SignatureAlgorithm

Získá název podpisového algoritmu, který je k dispozici s touto implementací RSA.Gets the name of the signature algorithm available with this implementation of RSA.

UseMachineKeyStore UseMachineKeyStore UseMachineKeyStore UseMachineKeyStore

Získá nebo nastaví hodnotu určující, zda klíč by měl uchovávaných v úložišti klíčů počítače namísto úložišti profilu uživatele.Gets or sets a value indicating whether the key should be persisted in the computer's key store instead of the user profile store.

Metody

Clear() Clear() Clear() Clear()

Uvolní všechny prostředky používané AsymmetricAlgorithm třídy.Releases all resources used by the AsymmetricAlgorithm class.

(Inherited from AsymmetricAlgorithm)
Decrypt(Byte[], Boolean) Decrypt(Byte[], Boolean) Decrypt(Byte[], Boolean) Decrypt(Byte[], Boolean)

Dešifruje data RSA algoritmus.Decrypts data with the RSA algorithm.

Decrypt(Byte[], RSAEncryptionPadding) Decrypt(Byte[], RSAEncryptionPadding) Decrypt(Byte[], RSAEncryptionPadding) Decrypt(Byte[], RSAEncryptionPadding)

Dešifruje data, která byla dříve zašifrována pomocí RSA algoritmus s použitím zadaného odsazení.Decrypts data that was previously encrypted with the RSA algorithm by using the specified padding.

DecryptValue(Byte[]) DecryptValue(Byte[]) DecryptValue(Byte[]) DecryptValue(Byte[])

Tato metoda není podporována v aktuální verzi.This method is not supported in the current version.

Dispose() Dispose() Dispose() Dispose()

Uvolní všechny prostředky používané aktuální instancí třídy AsymmetricAlgorithm třídy.Releases all resources used by the current instance of the AsymmetricAlgorithm class.

(Inherited from AsymmetricAlgorithm)
Dispose(Boolean) Dispose(Boolean) Dispose(Boolean) Dispose(Boolean)

Uvolní nespravované prostředky využívané třídou AsymmetricAlgorithm a volitelně také spravované prostředky.Releases the unmanaged resources used by the AsymmetricAlgorithm class and optionally releases the managed resources.

(Inherited from AsymmetricAlgorithm)
Encrypt(Byte[], Boolean) Encrypt(Byte[], Boolean) Encrypt(Byte[], Boolean) Encrypt(Byte[], Boolean)

Šifruje data pomocí RSA algoritmus.Encrypts data with the RSA algorithm.

Encrypt(Byte[], RSAEncryptionPadding) Encrypt(Byte[], RSAEncryptionPadding) Encrypt(Byte[], RSAEncryptionPadding) Encrypt(Byte[], RSAEncryptionPadding)

Šifruje data pomocí RSA algoritmus pomocí zadaného odsazení.Encrypts data with the RSA algorithm using the specified padding.

EncryptValue(Byte[]) EncryptValue(Byte[]) EncryptValue(Byte[]) EncryptValue(Byte[])

Tato metoda není podporována v aktuální verzi.This method is not supported in the current version.

Equals(Object) Equals(Object) Equals(Object) Equals(Object)

Určuje, zda se zadaný objekt rovná aktuálnímu objektu.Determines whether the specified object is equal to the current object.

(Inherited from Object)
ExportCspBlob(Boolean) ExportCspBlob(Boolean) ExportCspBlob(Boolean) ExportCspBlob(Boolean)

Exportuje objekt blob obsahující informace o klíči přidružené RSACryptoServiceProvider objektu.Exports a blob containing the key information associated with an RSACryptoServiceProvider object.

ExportEncryptedPkcs8PrivateKey(ReadOnlySpan<Byte>, PbeParameters) ExportEncryptedPkcs8PrivateKey(ReadOnlySpan<Byte>, PbeParameters) ExportEncryptedPkcs8PrivateKey(ReadOnlySpan<Byte>, PbeParameters) ExportEncryptedPkcs8PrivateKey(ReadOnlySpan<Byte>, PbeParameters) Inherited from AsymmetricAlgorithm
ExportEncryptedPkcs8PrivateKey(ReadOnlySpan<Char>, PbeParameters) ExportEncryptedPkcs8PrivateKey(ReadOnlySpan<Char>, PbeParameters) ExportEncryptedPkcs8PrivateKey(ReadOnlySpan<Char>, PbeParameters) ExportEncryptedPkcs8PrivateKey(ReadOnlySpan<Char>, PbeParameters) Inherited from AsymmetricAlgorithm
ExportParameters(Boolean) ExportParameters(Boolean) ExportParameters(Boolean) ExportParameters(Boolean)

Exporty RSAParameters.Exports the RSAParameters.

ExportPkcs8PrivateKey() ExportPkcs8PrivateKey() ExportPkcs8PrivateKey() ExportPkcs8PrivateKey() Inherited from AsymmetricAlgorithm
ExportRSAPrivateKey() ExportRSAPrivateKey() ExportRSAPrivateKey() ExportRSAPrivateKey() Inherited from RSA
ExportRSAPublicKey() ExportRSAPublicKey() ExportRSAPublicKey() ExportRSAPublicKey() Inherited from RSA
ExportSubjectPublicKeyInfo() ExportSubjectPublicKeyInfo() ExportSubjectPublicKeyInfo() ExportSubjectPublicKeyInfo() Inherited from AsymmetricAlgorithm
Finalize() Finalize() Finalize() Finalize()
FromXmlString(String) FromXmlString(String) FromXmlString(String) FromXmlString(String)

Inicializuje RSA objekt z informací o klíči z řetězce XML.Initializes an RSA object from the key information from an XML string.

(Inherited from RSA)
GetHashCode() GetHashCode() GetHashCode() GetHashCode()

Slouží jako výchozí funkce hash.Serves as the default hash function.

(Inherited from Object)
GetType() GetType() GetType() GetType()

Získá Type aktuální instance.Gets the Type of the current instance.

(Inherited from Object)
HashData(Byte[], Int32, Int32, HashAlgorithmName) HashData(Byte[], Int32, Int32, HashAlgorithmName) HashData(Byte[], Int32, Int32, HashAlgorithmName) HashData(Byte[], Int32, Int32, HashAlgorithmName)

Při přepisu v odvozené třídě, vypočítá hodnotu hash specifikovanou část bajtového pole pomocí zadaný hashovací algoritmus.When overridden in a derived class, computes the hash value of a specified portion of a byte array by using a specified hashing algorithm.

(Inherited from RSA)
HashData(Stream, HashAlgorithmName) HashData(Stream, HashAlgorithmName) HashData(Stream, HashAlgorithmName) HashData(Stream, HashAlgorithmName)

Při přepisu v odvozené třídě, vypočítá hodnotu hash zadaný binární datový proud s použitím zadaného algoritmu hash.When overridden in a derived class, computes the hash value of a specified binary stream by using a specified hashing algorithm.

(Inherited from RSA)
ImportCspBlob(Byte[]) ImportCspBlob(Byte[]) ImportCspBlob(Byte[]) ImportCspBlob(Byte[])

Importuje objekt blob, který představuje informace o klíči RSA.Imports a blob that represents RSA key information.

ImportEncryptedPkcs8PrivateKey(ReadOnlySpan<Byte>, ReadOnlySpan<Byte>, Int32) ImportEncryptedPkcs8PrivateKey(ReadOnlySpan<Byte>, ReadOnlySpan<Byte>, Int32) ImportEncryptedPkcs8PrivateKey(ReadOnlySpan<Byte>, ReadOnlySpan<Byte>, Int32) ImportEncryptedPkcs8PrivateKey(ReadOnlySpan<Byte>, ReadOnlySpan<Byte>, Int32) Inherited from AsymmetricAlgorithm
ImportEncryptedPkcs8PrivateKey(ReadOnlySpan<Char>, ReadOnlySpan<Byte>, Int32) ImportEncryptedPkcs8PrivateKey(ReadOnlySpan<Char>, ReadOnlySpan<Byte>, Int32) ImportEncryptedPkcs8PrivateKey(ReadOnlySpan<Char>, ReadOnlySpan<Byte>, Int32) ImportEncryptedPkcs8PrivateKey(ReadOnlySpan<Char>, ReadOnlySpan<Byte>, Int32) Inherited from AsymmetricAlgorithm
ImportParameters(RSAParameters) ImportParameters(RSAParameters) ImportParameters(RSAParameters) ImportParameters(RSAParameters)

Naimportuje zadaný RSAParameters.Imports the specified RSAParameters.

ImportPkcs8PrivateKey(ReadOnlySpan<Byte>, Int32) ImportPkcs8PrivateKey(ReadOnlySpan<Byte>, Int32) ImportPkcs8PrivateKey(ReadOnlySpan<Byte>, Int32) ImportPkcs8PrivateKey(ReadOnlySpan<Byte>, Int32) Inherited from AsymmetricAlgorithm
ImportRSAPrivateKey(ReadOnlySpan<Byte>, Int32) ImportRSAPrivateKey(ReadOnlySpan<Byte>, Int32) ImportRSAPrivateKey(ReadOnlySpan<Byte>, Int32) ImportRSAPrivateKey(ReadOnlySpan<Byte>, Int32) Inherited from RSA
ImportRSAPublicKey(ReadOnlySpan<Byte>, Int32) ImportRSAPublicKey(ReadOnlySpan<Byte>, Int32) ImportRSAPublicKey(ReadOnlySpan<Byte>, Int32) ImportRSAPublicKey(ReadOnlySpan<Byte>, Int32) Inherited from RSA
ImportSubjectPublicKeyInfo(ReadOnlySpan<Byte>, Int32) ImportSubjectPublicKeyInfo(ReadOnlySpan<Byte>, Int32) ImportSubjectPublicKeyInfo(ReadOnlySpan<Byte>, Int32) ImportSubjectPublicKeyInfo(ReadOnlySpan<Byte>, Int32) Inherited from AsymmetricAlgorithm
MemberwiseClone() MemberwiseClone() MemberwiseClone() MemberwiseClone()

Vytvoří Mělkou kopii aktuální Object.Creates a shallow copy of the current Object.

(Inherited from Object)
SignData(Byte[], HashAlgorithmName, RSASignaturePadding) SignData(Byte[], HashAlgorithmName, RSASignaturePadding) SignData(Byte[], HashAlgorithmName, RSASignaturePadding) SignData(Byte[], HashAlgorithmName, RSASignaturePadding)

Vypočítá hodnotu hash zadané bajtové pole pomocí zadaného hashovacího algoritmu a režim odsazení a podepisuje výsledné hodnoty hash.Computes the hash value of the specified byte array using the specified hash algorithm and padding mode, and signs the resulting hash value.

(Inherited from RSA)
SignData(Byte[], Int32, Int32, HashAlgorithmName, RSASignaturePadding) SignData(Byte[], Int32, Int32, HashAlgorithmName, RSASignaturePadding) SignData(Byte[], Int32, Int32, HashAlgorithmName, RSASignaturePadding) SignData(Byte[], Int32, Int32, HashAlgorithmName, RSASignaturePadding)

Vypočítá hodnotu hash z část zadané bajtové pole pomocí zadaného hashovacího algoritmu a režim odsazení a podepisuje výsledné hodnoty hash.Computes the hash value of a portion of the specified byte array using the specified hash algorithm and padding mode, and signs the resulting hash value.

(Inherited from RSA)
SignData(Byte[], Int32, Int32, Object) SignData(Byte[], Int32, Int32, Object) SignData(Byte[], Int32, Int32, Object) SignData(Byte[], Int32, Int32, Object)

Vypočítá hodnotu hash podmnožinu zadané bajtové pole pomocí algoritmu zadanou hodnotu hash a podepíše výslednou hodnotu hash.Computes the hash value of a subset of the specified byte array using the specified hash algorithm, and signs the resulting hash value.

SignData(Byte[], Object) SignData(Byte[], Object) SignData(Byte[], Object) SignData(Byte[], Object)

Vypočítá hodnotu hash zadané bajtové pole pomocí algoritmu zadanou hodnotu hash a podepíše výslednou hodnotu hash.Computes the hash value of the specified byte array using the specified hash algorithm, and signs the resulting hash value.

SignData(Stream, HashAlgorithmName, RSASignaturePadding) SignData(Stream, HashAlgorithmName, RSASignaturePadding) SignData(Stream, HashAlgorithmName, RSASignaturePadding) SignData(Stream, HashAlgorithmName, RSASignaturePadding)

Vypočítá hodnotu hash zadaného datového proudu pomocí zadaného hashovacího algoritmu a režim odsazení a podepisuje výsledné hodnoty hash.Computes the hash value of the specified stream using the specified hash algorithm and padding mode, and signs the resulting hash value.

(Inherited from RSA)
SignData(Stream, Object) SignData(Stream, Object) SignData(Stream, Object) SignData(Stream, Object)

Vypočítá hodnotu hash ze zadaného vstupního streamu s použitím zadaného hashovacího algoritmu a podepisuje výsledné hodnoty hash.Computes the hash value of the specified input stream using the specified hash algorithm, and signs the resulting hash value.

SignHash(Byte[], HashAlgorithmName, RSASignaturePadding) SignHash(Byte[], HashAlgorithmName, RSASignaturePadding) SignHash(Byte[], HashAlgorithmName, RSASignaturePadding) SignHash(Byte[], HashAlgorithmName, RSASignaturePadding)

Vypočítá podpis pro hodnotu zadanou hodnotu hash pomocí šifrování pomocí privátního klíče pomocí zadané odsazení.Computes the signature for the specified hash value by encrypting it with the private key using the specified padding.

SignHash(Byte[], String) SignHash(Byte[], String) SignHash(Byte[], String) SignHash(Byte[], String)

Vypočítá podpis pro hodnotu zadanou hodnotu hash šifrováním s privátním klíčem.Computes the signature for the specified hash value by encrypting it with the private key.

ToString() ToString() ToString() ToString()

Vrací řetězec, který představuje aktuální objekt.Returns a string that represents the current object.

(Inherited from Object)
ToXmlString(Boolean) ToXmlString(Boolean) ToXmlString(Boolean) ToXmlString(Boolean)

Vytvoří a vrátí řetězec XML obsahující klíč aktuální RSA objektu.Creates and returns an XML string containing the key of the current RSA object.

(Inherited from RSA)
TryDecrypt(ReadOnlySpan<Byte>, Span<Byte>, RSAEncryptionPadding, Int32) TryDecrypt(ReadOnlySpan<Byte>, Span<Byte>, RSAEncryptionPadding, Int32) TryDecrypt(ReadOnlySpan<Byte>, Span<Byte>, RSAEncryptionPadding, Int32) TryDecrypt(ReadOnlySpan<Byte>, Span<Byte>, RSAEncryptionPadding, Int32) Inherited from RSA
TryEncrypt(ReadOnlySpan<Byte>, Span<Byte>, RSAEncryptionPadding, Int32) TryEncrypt(ReadOnlySpan<Byte>, Span<Byte>, RSAEncryptionPadding, Int32) TryEncrypt(ReadOnlySpan<Byte>, Span<Byte>, RSAEncryptionPadding, Int32) TryEncrypt(ReadOnlySpan<Byte>, Span<Byte>, RSAEncryptionPadding, Int32) Inherited from RSA
TryExportEncryptedPkcs8PrivateKey(ReadOnlySpan<Byte>, PbeParameters, Span<Byte>, Int32) TryExportEncryptedPkcs8PrivateKey(ReadOnlySpan<Byte>, PbeParameters, Span<Byte>, Int32) TryExportEncryptedPkcs8PrivateKey(ReadOnlySpan<Byte>, PbeParameters, Span<Byte>, Int32) TryExportEncryptedPkcs8PrivateKey(ReadOnlySpan<Byte>, PbeParameters, Span<Byte>, Int32) Inherited from AsymmetricAlgorithm
TryExportEncryptedPkcs8PrivateKey(ReadOnlySpan<Char>, PbeParameters, Span<Byte>, Int32) TryExportEncryptedPkcs8PrivateKey(ReadOnlySpan<Char>, PbeParameters, Span<Byte>, Int32) TryExportEncryptedPkcs8PrivateKey(ReadOnlySpan<Char>, PbeParameters, Span<Byte>, Int32) TryExportEncryptedPkcs8PrivateKey(ReadOnlySpan<Char>, PbeParameters, Span<Byte>, Int32) Inherited from AsymmetricAlgorithm
TryExportPkcs8PrivateKey(Span<Byte>, Int32) TryExportPkcs8PrivateKey(Span<Byte>, Int32) TryExportPkcs8PrivateKey(Span<Byte>, Int32) TryExportPkcs8PrivateKey(Span<Byte>, Int32) Inherited from AsymmetricAlgorithm
TryExportRSAPrivateKey(Span<Byte>, Int32) TryExportRSAPrivateKey(Span<Byte>, Int32) TryExportRSAPrivateKey(Span<Byte>, Int32) TryExportRSAPrivateKey(Span<Byte>, Int32) Inherited from RSA
TryExportRSAPublicKey(Span<Byte>, Int32) TryExportRSAPublicKey(Span<Byte>, Int32) TryExportRSAPublicKey(Span<Byte>, Int32) TryExportRSAPublicKey(Span<Byte>, Int32) Inherited from RSA
TryExportSubjectPublicKeyInfo(Span<Byte>, Int32) TryExportSubjectPublicKeyInfo(Span<Byte>, Int32) TryExportSubjectPublicKeyInfo(Span<Byte>, Int32) TryExportSubjectPublicKeyInfo(Span<Byte>, Int32) Inherited from AsymmetricAlgorithm
TryHashData(ReadOnlySpan<Byte>, Span<Byte>, HashAlgorithmName, Int32) TryHashData(ReadOnlySpan<Byte>, Span<Byte>, HashAlgorithmName, Int32) TryHashData(ReadOnlySpan<Byte>, Span<Byte>, HashAlgorithmName, Int32) TryHashData(ReadOnlySpan<Byte>, Span<Byte>, HashAlgorithmName, Int32) Inherited from RSA
TrySignData(ReadOnlySpan<Byte>, Span<Byte>, HashAlgorithmName, RSASignaturePadding, Int32) TrySignData(ReadOnlySpan<Byte>, Span<Byte>, HashAlgorithmName, RSASignaturePadding, Int32) TrySignData(ReadOnlySpan<Byte>, Span<Byte>, HashAlgorithmName, RSASignaturePadding, Int32) TrySignData(ReadOnlySpan<Byte>, Span<Byte>, HashAlgorithmName, RSASignaturePadding, Int32) Inherited from RSA
TrySignHash(ReadOnlySpan<Byte>, Span<Byte>, HashAlgorithmName, RSASignaturePadding, Int32) TrySignHash(ReadOnlySpan<Byte>, Span<Byte>, HashAlgorithmName, RSASignaturePadding, Int32) TrySignHash(ReadOnlySpan<Byte>, Span<Byte>, HashAlgorithmName, RSASignaturePadding, Int32) TrySignHash(ReadOnlySpan<Byte>, Span<Byte>, HashAlgorithmName, RSASignaturePadding, Int32) Inherited from RSA
VerifyData(Byte[], Byte[], HashAlgorithmName, RSASignaturePadding) VerifyData(Byte[], Byte[], HashAlgorithmName, RSASignaturePadding) VerifyData(Byte[], Byte[], HashAlgorithmName, RSASignaturePadding) VerifyData(Byte[], Byte[], HashAlgorithmName, RSASignaturePadding)

Ověří, jestli je digitální podpis výpočtem hodnoty hash zadaná data pomocí zadaného platná hodnota hash algoritmu a odsazení a porovná je s poskytnutého signatury.Verifies that a digital signature is valid by calculating the hash value of the specified data using the specified hash algorithm and padding, and comparing it to the provided signature.

(Inherited from RSA)
VerifyData(Byte[], Int32, Int32, Byte[], HashAlgorithmName, RSASignaturePadding) VerifyData(Byte[], Int32, Int32, Byte[], HashAlgorithmName, RSASignaturePadding) VerifyData(Byte[], Int32, Int32, Byte[], HashAlgorithmName, RSASignaturePadding) VerifyData(Byte[], Int32, Int32, Byte[], HashAlgorithmName, RSASignaturePadding)

Ověřuje, že digitální podpis je platný podle výpočtu hodnoty hash dat v části bajtového pole pomocí zadaného hodnota hash algoritmu a odsazení a porovná je s poskytnutého signatury.Verifies that a digital signature is valid by calculating the hash value of the data in a portion of a byte array using the specified hash algorithm and padding, and comparing it to the provided signature.

(Inherited from RSA)
VerifyData(Byte[], Object, Byte[]) VerifyData(Byte[], Object, Byte[]) VerifyData(Byte[], Object, Byte[]) VerifyData(Byte[], Object, Byte[])

Ověří, jestli je digitální podpis platný tak, že určíte hodnotu hash hodnoty v signatuře pomocí zadaného veřejného klíče a porovná je hodnota hash pro zadaná data.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.

VerifyData(ReadOnlySpan<Byte>, ReadOnlySpan<Byte>, HashAlgorithmName, RSASignaturePadding) VerifyData(ReadOnlySpan<Byte>, ReadOnlySpan<Byte>, HashAlgorithmName, RSASignaturePadding) VerifyData(ReadOnlySpan<Byte>, ReadOnlySpan<Byte>, HashAlgorithmName, RSASignaturePadding) VerifyData(ReadOnlySpan<Byte>, ReadOnlySpan<Byte>, HashAlgorithmName, RSASignaturePadding) Inherited from RSA
VerifyData(Stream, Byte[], HashAlgorithmName, RSASignaturePadding) VerifyData(Stream, Byte[], HashAlgorithmName, RSASignaturePadding) VerifyData(Stream, Byte[], HashAlgorithmName, RSASignaturePadding) VerifyData(Stream, Byte[], HashAlgorithmName, RSASignaturePadding)

Ověří, jestli je digitální podpis výpočtem hodnoty hash zadaného datového proudu pomocí zadaného platná hodnota hash algoritmu a odsazení a porovná je s poskytnutého signatury.Verifies that a digital signature is valid by calculating the hash value of the specified stream using the specified hash algorithm and padding, and comparing it to the provided signature.

(Inherited from RSA)
VerifyHash(Byte[], Byte[], HashAlgorithmName, RSASignaturePadding) VerifyHash(Byte[], Byte[], HashAlgorithmName, RSASignaturePadding) VerifyHash(Byte[], Byte[], HashAlgorithmName, RSASignaturePadding) VerifyHash(Byte[], Byte[], HashAlgorithmName, RSASignaturePadding)

Ověří, jestli je digitální podpis platný tak, že určíte hodnotu hash v podpisu pomocí zadané algoritmu hash algoritmus odsazení a porovnání k hodnotě zadané hodnoty hash.Verifies that a digital signature is valid by determining the hash value in the signature using the specified hashing algorithm and padding, and comparing it to the provided hash value.

VerifyHash(Byte[], String, Byte[]) VerifyHash(Byte[], String, Byte[]) VerifyHash(Byte[], String, Byte[]) VerifyHash(Byte[], String, Byte[])

Ověří, jestli je digitální podpis platný tak, že určíte hodnotu hash hodnoty v signatuře pomocí zadaného veřejného klíče a porovná je hodnota zadaná hodnota hash.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.

VerifyHash(ReadOnlySpan<Byte>, ReadOnlySpan<Byte>, HashAlgorithmName, RSASignaturePadding) VerifyHash(ReadOnlySpan<Byte>, ReadOnlySpan<Byte>, HashAlgorithmName, RSASignaturePadding) VerifyHash(ReadOnlySpan<Byte>, ReadOnlySpan<Byte>, HashAlgorithmName, RSASignaturePadding) VerifyHash(ReadOnlySpan<Byte>, ReadOnlySpan<Byte>, HashAlgorithmName, RSASignaturePadding) Inherited from RSA

Pole

KeySizeValue KeySizeValue KeySizeValue KeySizeValue

Představuje velikost v bitech, modulu klíče používané asymetrického algoritmu.Represents the size, in bits, of the key modulus used by the asymmetric algorithm.

(Inherited from AsymmetricAlgorithm)
LegalKeySizesValue LegalKeySizesValue LegalKeySizesValue LegalKeySizesValue

Určuje velikostí klíče, které jsou podporovány asymetrického algoritmu.Specifies the key sizes that are supported by the asymmetric algorithm.

(Inherited from AsymmetricAlgorithm)

Explicitní implementace rozhraní

IDisposable.Dispose() IDisposable.Dispose() IDisposable.Dispose() IDisposable.Dispose()

Popis tohoto členu viz Dispose().For a description of this member, see Dispose().

(Inherited from AsymmetricAlgorithm)

Platí pro

Viz také