次の方法で共有


DSACryptoServiceProvider.ExportParameters メソッド

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

Overrides Public Function ExportParameters( _
   ByVal includePrivateParameters As Boolean _) As DSAParameters
[C#]
public override DSAParameters ExportParameters(boolincludePrivateParameters);
[C++]
public: DSAParameters ExportParameters(boolincludePrivateParameters);
[JScript]
public override function ExportParameters(
   includePrivateParameters : Boolean) : DSAParameters;

パラメータ

  • includePrivateParameters
    プライベート パラメータを含める場合は true 。それ以外の場合は false

戻り値

DSA のパラメータ。

例外

例外の種類 条件
CryptographicException キーをエクスポートできません。

使用例

 
Try
    'Create a new DSACryptoServiceProvider object.
    Dim DSA As New DSACryptoServiceProvider()


    'Export the key information to an DSAParameters object.
    'Pass false to export the public key information or pass
    'true to export public and private key information.
    Dim DSAParams As DSAParameters = DSA.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 DSACryptoServiceProvider object.
    DSACryptoServiceProvider DSA = new DSACryptoServiceProvider();


    //Export the key information to an DSAParameters object.
    //Pass false to export the public key information or pass
    //true to export public and private key information.
    DSAParameters DSAParams = DSA.ExportParameters(false);


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

}

[C++] 
try {
    //Create a new DSACryptoServiceProvider object.
    DSACryptoServiceProvider* DSA = new DSACryptoServiceProvider();

    //Export the key information to an DSAParameters object.
    //Pass false to export the public key information or pass
    //true to export public and private key information.
    DSAParameters DSAParams = DSA->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 ファミリ

参照

DSACryptoServiceProvider クラス | DSACryptoServiceProvider メンバ | System.Security.Cryptography 名前空間 | 暗号サービス