RSACryptoServiceProvider クラス

定義

暗号化サービス プロバイダー (CSP) によって提供される RSA アルゴリズムの実装を使用して、非対称の暗号化と暗号化解除を実行します。 このクラスは継承できません。

public ref class RSACryptoServiceProvider sealed : System::Security::Cryptography::RSA, System::Security::Cryptography::ICspAsymmetricAlgorithm
public ref class RSACryptoServiceProvider sealed : System::Security::Cryptography::RSA
public sealed class RSACryptoServiceProvider : System.Security.Cryptography.RSA, System.Security.Cryptography.ICspAsymmetricAlgorithm
public sealed class RSACryptoServiceProvider : System.Security.Cryptography.RSA
[System.Runtime.InteropServices.ComVisible(true)]
public sealed class RSACryptoServiceProvider : System.Security.Cryptography.RSA, System.Security.Cryptography.ICspAsymmetricAlgorithm
type RSACryptoServiceProvider = class
    inherit RSA
    interface ICspAsymmetricAlgorithm
type RSACryptoServiceProvider = class
    inherit RSA
[<System.Runtime.InteropServices.ComVisible(true)>]
type RSACryptoServiceProvider = class
    inherit RSA
    interface ICspAsymmetricAlgorithm
Public NotInheritable Class RSACryptoServiceProvider
Inherits RSA
Implements ICspAsymmetricAlgorithm
Public NotInheritable Class RSACryptoServiceProvider
Inherits RSA
継承
RSACryptoServiceProvider
属性
実装

次のコード例では、 クラスを RSACryptoServiceProvider 使用して文字列をバイト配列に暗号化し、バイトを文字列に復号化します。

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
                //to include 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.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

次のコード例では、 を使用して作成されたキー情報を RSACryptoServiceProvider オブジェクトに RSAParameters エクスポートします。

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

注釈

この API の詳細については、「 RSACryptoServiceProvider の補足 API 解説」を参照してください。

コンストラクター

RSACryptoServiceProvider()

ランダムなキーのペアで、RSACryptoServiceProvider クラスの新しいインスタンスを初期化します。

RSACryptoServiceProvider(CspParameters)

指定したパラメーターを使用して、RSACryptoServiceProvider クラスの新しいインスタンスを初期化します。

RSACryptoServiceProvider(Int32)

指定したキー サイズのランダムなキー ペアで、RSACryptoServiceProvider クラスの新しいインスタンスを初期化します。

RSACryptoServiceProvider(Int32, CspParameters)

指定されたキー サイズおよびパラメーターを使用して、RSACryptoServiceProvider クラスの新しいインスタンスを初期化します。

フィールド

KeySizeValue

非対称アルゴリズムで使用されるキー モジュラスのサイズをビット単位で表します。

(継承元 AsymmetricAlgorithm)
LegalKeySizesValue

非対称アルゴリズムでサポートされているキー サイズを指定します。

(継承元 AsymmetricAlgorithm)

プロパティ

CspKeyContainerInfo

暗号化キーの組に関する追加情報を説明する CspKeyContainerInfo オブジェクトを取得します。

KeyExchangeAlgorithm

RSA のこの実装で使用可能なキー交換アルゴリズムの名前を取得します。

KeyExchangeAlgorithm

RSA のこの実装で使用可能なキー交換アルゴリズムの名前を取得します。

(継承元 RSA)
KeySize

カーソル キーのサイズを取得します。

LegalKeySizes

非対称アルゴリズムでサポートされているキー サイズを取得します。

LegalKeySizes

非対称アルゴリズムでサポートされているキー サイズを取得します。

(継承元 AsymmetricAlgorithm)
PersistKeyInCsp

暗号化サービス プロバイダー (CSP) にキーを保存するかどうかを示す値を取得または設定します。

PublicOnly

RSACryptoServiceProvider オブジェクトに公開キーだけが含まれているかどうかを示す値を取得します。

SignatureAlgorithm

RSA のこの実装で使用可能なキー交換アルゴリズムの名前を取得します。

SignatureAlgorithm

RSA のこの実装で使用可能なキー交換アルゴリズムの名前を取得します。

(継承元 RSA)
UseMachineKeyStore

キーをユーザー プロファイル ストアではなくコンピューターのキー ストア内で永続化するかどうかを示す値を取得または設定します。

メソッド

Clear()

AsymmetricAlgorithm クラスによって使用されているすべてのリソースを解放します。

(継承元 AsymmetricAlgorithm)
Decrypt(Byte[], Boolean)

RSA アルゴリズムでデータを復号化します。

Decrypt(Byte[], RSAEncryptionPadding)

指定された埋め込みを使用した RSA アルゴリズムで暗号化されたデータを復号化します。

Decrypt(Byte[], RSAEncryptionPadding)

派生クラスでオーバーライドされると、指定されたパディング モードを使用して入力データを復号化します。

(継承元 RSA)
Decrypt(ReadOnlySpan<Byte>, RSAEncryptionPadding)

指定したパディング モードを使用して、入力データを復号化します。

(継承元 RSA)
Decrypt(ReadOnlySpan<Byte>, Span<Byte>, RSAEncryptionPadding)

指定したパディング モードを使用して、入力データを復号化します。

(継承元 RSA)
DecryptValue(Byte[])
古い.

このメソッドは、現在のバージョンではサポートされていません。

DecryptValue(Byte[])
古い.

派生クラスでオーバーライドされると、秘密キーを使用して入力データの暗号化を解除します。

(継承元 RSA)
Dispose()

AsymmetricAlgorithm クラスの現在のインスタンスによって使用されているすべてのリソースを解放します。

(継承元 AsymmetricAlgorithm)
Dispose(Boolean)

AsymmetricAlgorithm クラスによって使用されているアンマネージド リソースを解放し、オプションでマネージド リソースも解放します。

(継承元 AsymmetricAlgorithm)
Encrypt(Byte[], Boolean)

RSA アルゴリズムでデータを暗号化します。

Encrypt(Byte[], RSAEncryptionPadding)

指定されたパディングを使用した RSA アルゴリズムでデータを暗号化します。

Encrypt(Byte[], RSAEncryptionPadding)

派生クラスでオーバーライドされると、指定されたパディング モードを使用して入力データを暗号化します。

(継承元 RSA)
Encrypt(ReadOnlySpan<Byte>, RSAEncryptionPadding)

指定したパディング モードを使用して、入力データを暗号化します。

(継承元 RSA)
Encrypt(ReadOnlySpan<Byte>, Span<Byte>, RSAEncryptionPadding)

指定したパディング モードを使用して、入力データを暗号化します。

(継承元 RSA)
EncryptValue(Byte[])
古い.

このメソッドは、現在のバージョンではサポートされていません。

EncryptValue(Byte[])
古い.

派生クラスでオーバーライドされると、公開キーを使用して入力データを暗号化します。

(継承元 RSA)
Equals(Object)

指定されたオブジェクトが現在のオブジェクトと等しいかどうかを判断します。

(継承元 Object)
ExportCspBlob(Boolean)

RSACryptoServiceProvider オブジェクトに関連付けられたキー情報を含む blob をエクスポートします。

ExportEncryptedPkcs8PrivateKey(ReadOnlySpan<Byte>, PbeParameters)

現在のキーを PKCS# 8 EncryptedPrivateKeyInfo 形式で、バイトベースのパスワードを使用してエクスポートします。

(継承元 AsymmetricAlgorithm)
ExportEncryptedPkcs8PrivateKey(ReadOnlySpan<Char>, PbeParameters)

現在のキーを PKCS# 8 EncryptedPrivateKeyInfo 形式で、char ベースのパスワードを使用してエクスポートします。

(継承元 AsymmetricAlgorithm)
ExportEncryptedPkcs8PrivateKeyPem(ReadOnlySpan<Byte>, PbeParameters)

PKCS#8 EncryptedPrivateKeyInfo 形式の現在のキーを、PEM でエンコードされたバイトベースのパスワードでエクスポートします。

(継承元 AsymmetricAlgorithm)
ExportEncryptedPkcs8PrivateKeyPem(ReadOnlySpan<Char>, PbeParameters)

PKCS#8 EncryptedPrivateKeyInfo 形式の現在のキーを、文字ベースのパスワード PEM エンコードでエクスポートします。

(継承元 AsymmetricAlgorithm)
ExportParameters(Boolean)

RSAParameters をエクスポートします。

ExportPkcs8PrivateKey()

現在のキーを PKCS# 8 PrivateKeyInfo 形式でエクスポートします。

(継承元 AsymmetricAlgorithm)
ExportPkcs8PrivateKeyPem()

現在のキーを PKCS#8 PrivateKeyInfo 形式 (PEM エンコード) でエクスポートします。

(継承元 AsymmetricAlgorithm)
ExportRSAPrivateKey()

現在のキーを PKCS#1 RSAPrivateKey 形式でエクスポートします。

(継承元 RSA)
ExportRSAPrivateKeyPem()

PKCS#1 RSAPrivateKey 形式 (PEM エンコード) で現在のキーをエクスポートします。

(継承元 RSA)
ExportRSAPublicKey()

現在のキーの公開キーの部分を、PKCS#1 RSAPublicKey 形式でエクスポートします。

(継承元 RSA)
ExportRSAPublicKeyPem()

現在のキーの公開キー部分を PKCS#1 RSAPublicKey 形式 (PEM エンコード) でエクスポートします。

(継承元 RSA)
ExportSubjectPublicKeyInfo()

現在のキーの公開キーの部分を、X.509 SubjectPublicKeyInfo 形式でエクスポートします。

(継承元 AsymmetricAlgorithm)
ExportSubjectPublicKeyInfoPem()

現在のキーの公開キー部分を、PEM でエンコードされた X.509 SubjectPublicKeyInfo 形式でエクスポートします。

(継承元 AsymmetricAlgorithm)
Finalize()

このインスタンスによって保持されているアンマネージ リソースを解放します。

FromXmlString(String)

XML 文字列のキー情報から RSA オブジェクトを初期化します。

(継承元 RSA)
GetHashCode()

既定のハッシュ関数として機能します。

(継承元 Object)
GetMaxOutputSize()

RSA 操作で生成できる最大バイト数を取得します。

(継承元 RSA)
GetType()

現在のインスタンスの Type を取得します。

(継承元 Object)
HashData(Byte[], Int32, Int32, HashAlgorithmName)

派生クラスでオーバーライドされると、指定したハッシュ アルゴリズムを使用して、指定したバイト配列部分のハッシュ値が計算されます。

(継承元 RSA)
HashData(Stream, HashAlgorithmName)

派生クラスでオーバーライドされると、指定したハッシュ アルゴリズムを使用して、指定したバイナリ ストリームのハッシュ値が計算されます。

(継承元 RSA)
ImportCspBlob(Byte[])

RSA キーの情報を表す blob をインポートします。

ImportEncryptedPkcs8PrivateKey(ReadOnlySpan<Byte>, ReadOnlySpan<Byte>, Int32)

バイトベースのパスワードを使用して暗号化解除した後に、PKCS#8 EncryptedPrivateKeyInfo 構造体から公開/秘密キー ペアをインポートし、このオブジェクトのキーを置き換えます。

ImportEncryptedPkcs8PrivateKey(ReadOnlySpan<Byte>, ReadOnlySpan<Byte>, Int32)

バイトベースのパスワードを使用して暗号化解除した後に、PKCS#8 EncryptedPrivateKeyInfo 構造体から公開/秘密キー ペアをインポートし、このオブジェクトのキーを置き換えます。

(継承元 RSA)
ImportEncryptedPkcs8PrivateKey(ReadOnlySpan<Char>, ReadOnlySpan<Byte>, Int32)

char ベースのパスワードを使用して暗号化解除した後に、PKCS#8 EncryptedPrivateKeyInfo 構造体から公開/秘密キー ペアをインポートし、このオブジェクトのキーを置き換えます。

ImportEncryptedPkcs8PrivateKey(ReadOnlySpan<Char>, ReadOnlySpan<Byte>, Int32)

char ベースのパスワードを使用して暗号化解除した後に、PKCS#8 EncryptedPrivateKeyInfo 構造体から公開/秘密キー ペアをインポートし、このオブジェクトのキーを置き換えます。

(継承元 RSA)
ImportFromEncryptedPem(ReadOnlySpan<Char>, ReadOnlySpan<Byte>)

暗号化された RFC 7468 PEM でエンコードされた秘密キーをインポートして、このオブジェクトのキーを置き換えます。

(継承元 RSA)
ImportFromEncryptedPem(ReadOnlySpan<Char>, ReadOnlySpan<Char>)

暗号化された RFC 7468 PEM でエンコードされた秘密キーをインポートして、このオブジェクトのキーを置き換えます。

(継承元 RSA)
ImportFromPem(ReadOnlySpan<Char>)

RFC 7468 PEM でエンコードされたキーをインポートして、このオブジェクトのキーを置き換えます。

(継承元 RSA)
ImportParameters(RSAParameters)

指定された RSAParameters をインポートします。

ImportPkcs8PrivateKey(ReadOnlySpan<Byte>, Int32)

暗号化解除した後に、PKCS#8 PrivateKeyInfo 構造体から公開/秘密キー ペアをインポートし、このオブジェクトのキーを置き換えます。

(継承元 RSA)
ImportRSAPrivateKey(ReadOnlySpan<Byte>, Int32)

暗号化解除した後に、PKCS#1 RSAPrivateKey 構造体から公開/秘密キー ペアをインポートし、このオブジェクトのキーを置き換えます。

(継承元 RSA)
ImportRSAPublicKey(ReadOnlySpan<Byte>, Int32)

暗号化解除した後に、PKCS#1 RSAPublicKey 構造体から公開キーをインポートし、このオブジェクトのキーを置き換えます。

(継承元 RSA)
ImportSubjectPublicKeyInfo(ReadOnlySpan<Byte>, Int32)

暗号化解除した後に、X.509 SubjectPublicKeyInfo 構造体から公開キーをインポートし、このオブジェクトのキーを置き換えます。

(継承元 RSA)
MemberwiseClone()

現在の Object の簡易コピーを作成します。

(継承元 Object)
SignData(Byte[], HashAlgorithmName, RSASignaturePadding)

指定したハッシュ アルゴリズムおよびパディング モードを使用して、指定したバイト配列のハッシュ値を計算し、結果のハッシュ値に署名します。

(継承元 RSA)
SignData(Byte[], Int32, Int32, HashAlgorithmName, RSASignaturePadding)

指定したハッシュ アルゴリズムおよびパディング モードを使用して、指定したバイト配列の一部分のハッシュ値を計算し、結果のハッシュ値に署名します。

(継承元 RSA)
SignData(Byte[], Int32, Int32, Object)

指定したハッシュ アルゴリズムを使用して、指定したバイト配列のサブセットのハッシュ値を計算し、結果のハッシュ値に署名します。

SignData(Byte[], Object)

指定したハッシュ アルゴリズムを使用して、指定したバイト配列のハッシュ値を計算し、結果のハッシュ値に署名します。

SignData(ReadOnlySpan<Byte>, HashAlgorithmName, RSASignaturePadding)

指定したデータのハッシュ値を計算し、それに署名します。

(継承元 RSA)
SignData(ReadOnlySpan<Byte>, Span<Byte>, HashAlgorithmName, RSASignaturePadding)

指定したアルゴリズムを使用して指定されたデータのハッシュを計算し、現在のキーでハッシュに署名し、指定されたバッファーに署名を書き込みます。

(継承元 RSA)
SignData(Stream, HashAlgorithmName, RSASignaturePadding)

指定したハッシュ アルゴリズムおよびパディング モードを使用して、指定したストリームのハッシュ値を計算し、結果のハッシュ値に署名します。

(継承元 RSA)
SignData(Stream, Object)

指定したハッシュ アルゴリズムを使用して、指定した入力ストリームのハッシュ値を計算し、結果のハッシュ値に署名します。

SignHash(Byte[], HashAlgorithmName, RSASignaturePadding)

指定したパディングを使用して、指定したハッシュ値の署名を計算します。

SignHash(Byte[], HashAlgorithmName, RSASignaturePadding)

派生クラスでオーバーライドされると、指定されたパディングを使用して、指定されたハッシュ値の署名を計算します。

(継承元 RSA)
SignHash(Byte[], String)

指定したハッシュ値の署名を計算します。

SignHash(ReadOnlySpan<Byte>, HashAlgorithmName, RSASignaturePadding)

指定したパディングを使用して、指定したハッシュ値の署名を計算します。

(継承元 RSA)
SignHash(ReadOnlySpan<Byte>, Span<Byte>, HashAlgorithmName, RSASignaturePadding)

現在のキーを使用してハッシュに署名し、指定されたバッファーに署名を書き込みます。

(継承元 RSA)
ToString()

現在のオブジェクトを表す文字列を返します。

(継承元 Object)
ToXmlString(Boolean)

現在の RSA オブジェクトのキーを格納している XML 文字列を作成して返します。

(継承元 RSA)
TryDecrypt(ReadOnlySpan<Byte>, Span<Byte>, RSAEncryptionPadding, Int32)

指定したパディング モードを使用して入力データを復号化し、その結果を指定したバッファーに書き込むことを試みます。

(継承元 RSA)
TryEncrypt(ReadOnlySpan<Byte>, Span<Byte>, RSAEncryptionPadding, Int32)

指定したパディング モードで、指定したバッファーに入力データを暗号化することを試みます。

(継承元 RSA)
TryExportEncryptedPkcs8PrivateKey(ReadOnlySpan<Byte>, PbeParameters, Span<Byte>, Int32)

バイトベースのパスワードを使用して、現在のキーを PKCS#8 EncryptedPrivateKeyInfo 形式で指定のバッファーにエクスポートすることを試みます。

(継承元 RSA)
TryExportEncryptedPkcs8PrivateKey(ReadOnlySpan<Char>, PbeParameters, Span<Byte>, Int32)

char ベースのパスワードを使用して、PKCS#8 EncryptedPrivateKeyInfo 形式の現在のキーを、指定されたバッファーにエクスポートすることを試みます。

(継承元 RSA)
TryExportEncryptedPkcs8PrivateKeyPem(ReadOnlySpan<Byte>, PbeParameters, Span<Char>, Int32)

PKCS#8 EncryptedPrivateKeyInfo 形式の現在のキーを、PEM でエンコードされたバイトベースのパスワードでエクスポートしようとします。

(継承元 AsymmetricAlgorithm)
TryExportEncryptedPkcs8PrivateKeyPem(ReadOnlySpan<Char>, PbeParameters, Span<Char>, Int32)

PKCS#8 EncryptedPrivateKeyInfo 形式の現在のキーを、文字ベースのパスワード PEM エンコードでエクスポートします。

(継承元 AsymmetricAlgorithm)
TryExportPkcs8PrivateKey(Span<Byte>, Int32)

PKCS#8 PrivateKeyInfo 形式の現在のキーを、指定のバッファーにエクスポートすることを試みます。

(継承元 RSA)
TryExportPkcs8PrivateKeyPem(Span<Char>, Int32)

PEM でエンコードされた PKCS#8 PrivateKeyInfo 形式の現在のキーを、指定されたバッファーにエクスポートしようとします。

(継承元 AsymmetricAlgorithm)
TryExportRSAPrivateKey(Span<Byte>, Int32)

現在のキーを PKCS#1 RSAPrivateKey 形式で指定のバッファーにエクスポートすることを試みます。

(継承元 RSA)
TryExportRSAPrivateKeyPem(Span<Char>, Int32)

PEM でエンコードされた PKCS#1 RSAPrivateKey 形式の現在のキーを、指定されたバッファーにエクスポートしようとします。

(継承元 RSA)
TryExportRSAPublicKey(Span<Byte>, Int32)

現在のキーを PKCS#1 RSAPublicKey 形式で指定のバッファーにエクスポートすることを試みます。

(継承元 RSA)
TryExportRSAPublicKeyPem(Span<Char>, Int32)

PEM でエンコードされた PKCS#1 RSAPublicKey 形式の現在のキーを、指定されたバッファーにエクスポートしようとします。

(継承元 RSA)
TryExportSubjectPublicKeyInfo(Span<Byte>, Int32)

現在のキーを X.509 SubjectPublicKeyInfo 形式で指定のバッファーにエクスポートすることを試みます。

(継承元 RSA)
TryExportSubjectPublicKeyInfoPem(Span<Char>, Int32)

PEM でエンコードされた X.509 SubjectPublicKeyInfo 形式の現在のキーを、指定されたバッファーにエクスポートしようとします。

(継承元 AsymmetricAlgorithm)
TryHashData(ReadOnlySpan<Byte>, Span<Byte>, HashAlgorithmName, Int32)

指定されたアルゴリズムを使用して指定されたデータのハッシュを計算し、その結果を指定されたバッファーに書き込むことを試みます。

(継承元 RSA)
TrySignData(ReadOnlySpan<Byte>, Span<Byte>, HashAlgorithmName, RSASignaturePadding, Int32)

指定されたアルゴリズムで、指定されたデータをハッシュし、現在のキーでハッシュを署名して、その結果を指定されたバッファーに書き込むことを試みます。

(継承元 RSA)
TrySignHash(ReadOnlySpan<Byte>, Span<Byte>, HashAlgorithmName, RSASignaturePadding, Int32)

現在のキーで、ハッシュを署名して、その結果を指定されたバッファーに書き込むことを試みます。

(継承元 RSA)
VerifyData(Byte[], Byte[], HashAlgorithmName, RSASignaturePadding)

指定したハッシュ アルゴリズムとパディングを使用して、指定したデーターのハッシュ値を計算し、これを指定した署名と比較することによって、デジタル署名が有効であることを確認します。

(継承元 RSA)
VerifyData(Byte[], Int32, Int32, Byte[], HashAlgorithmName, RSASignaturePadding)

指定したハッシュ アルゴリズムとパディングを使用して、バイト配列の部分のデータのハッシュ値を計算し、これを指定した署名と比較することによって、デジタル署名が有効であることを確認します。

(継承元 RSA)
VerifyData(Byte[], Object, Byte[])

指定した公開キーを使用して署名のハッシュ値を決定し、この値と指定したデータのハッシュ値とを比較することによって、デジタル署名が有効であることを確認します。

VerifyData(ReadOnlySpan<Byte>, ReadOnlySpan<Byte>, HashAlgorithmName, RSASignaturePadding)

指定したハッシュ アルゴリズムとパディングを使用して、指定したデーターのハッシュ値を計算し、これを指定した署名と比較することによって、デジタル署名が有効であることを確認します。

(継承元 RSA)
VerifyData(Stream, Byte[], HashAlgorithmName, RSASignaturePadding)

指定したハッシュ アルゴリズムとパディングを使用して、指定したストリームのハッシュ値を計算し、これを指定した署名と比較することによって、デジタル署名が有効であることを確認します。

(継承元 RSA)
VerifyHash(Byte[], Byte[], HashAlgorithmName, RSASignaturePadding)

指定したハッシュ アルゴリズムとパディングを使用して、署名のハッシュ値を決定し、これを指定したハッシュ値と比較することによって、デジタル署名が有効であることを確認します。

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

指定したハッシュ アルゴリズムとパディングを使用して、署名のハッシュ値を決定し、これを指定したハッシュ値と比較することによって、デジタル署名が有効であることを確認します。

(継承元 RSA)
VerifyHash(Byte[], String, Byte[])

指定した公開キーを使用して署名のハッシュ値を決定し、この値と指定したハッシュ値とを比較することによって、デジタル署名が正しいことを確認します。

VerifyHash(ReadOnlySpan<Byte>, ReadOnlySpan<Byte>, HashAlgorithmName, RSASignaturePadding)

指定したハッシュ アルゴリズムとパディングを使用して、署名のハッシュ値を決定し、これを指定したハッシュ値と比較することによって、デジタル署名が有効であることを確認します。

(継承元 RSA)

明示的なインターフェイスの実装

IDisposable.Dispose()

この API は製品インフラストラクチャをサポートします。コードから直接使用するものではありません。

このメンバーの詳細については、「Dispose()」をご覧ください。

(継承元 AsymmetricAlgorithm)

適用対象

こちらもご覧ください