RSACryptoServiceProvider.ExportParameters メソッド
RSAParameters をエクスポートします。
Overrides Public Function ExportParameters( _
ByVal includePrivateParameters As Boolean _) As RSAParameters
[C#]
public override RSAParameters ExportParameters(boolincludePrivateParameters);
[C++]
public: RSAParameters ExportParameters(boolincludePrivateParameters);
[JScript]
public override function ExportParameters(
includePrivateParameters : Boolean) : RSAParameters;
パラメータ
- includePrivateParameters
プライベート パラメータを含める場合は true 。それ以外の場合は false 。
戻り値
RSA のパラメータ。
例外
例外の種類 | 条件 |
---|---|
CryptographicException | キーをエクスポートできません。 |
使用例
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
[C#]
try
{
//Create a new RSACryptoServiceProvider object.
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);
}
[C++]
try {
//Create a new RSACryptoServiceProvider Object*.
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);
}
[JScript] JScript のサンプルはありません。Visual Basic、C#、および C++ のサンプルを表示するには、このページの左上隅にある言語のフィルタ ボタン をクリックします。
必要条件
プラットフォーム: Windows 98, Windows NT 4.0, Windows Millennium Edition, Windows 2000, Windows XP Home Edition, Windows XP Professional, Windows Server 2003 ファミリ
参照
RSACryptoServiceProvider クラス | RSACryptoServiceProvider メンバ | System.Security.Cryptography 名前空間 | 暗号サービス