RSACryptoServiceProvider.ExportParameters(Boolean) Methode

Definitie

Exporteert de RSAParameters.

public:
 override System::Security::Cryptography::RSAParameters ExportParameters(bool includePrivateParameters);
public override System.Security.Cryptography.RSAParameters ExportParameters(bool includePrivateParameters);
override this.ExportParameters : bool -> System.Security.Cryptography.RSAParameters
Public Overrides Function ExportParameters (includePrivateParameters As Boolean) As RSAParameters

Parameters

includePrivateParameters
Boolean

true om persoonlijke parameters op te nemen; anders, false.

Retouren

De parameters voor RSA.

Uitzonderingen

De sleutel kan niet worden geëxporteerd.

Voorbeelden

In het volgende codevoorbeeld worden de belangrijkste gegevens geëxporteerd die zijn gemaakt met behulp van het RSACryptoServiceProvider object in een RSAParameters object.

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

Van toepassing op

Zie ook