Windows Dev Center

AsymmetricKeyAlgorithmProvider.AlgorithmName | algorithmName property

Gets the name of the open asymmetric algorithm.

Syntax


var algorithmName = asymmetricKeyAlgorithmProvider.algorithmName;

Property value

Type: String [JavaScript] | System.String [.NET] | Platform::String [C++]

Algorithm name.

Remarks

You must call OpenAlgorithm before calling the AlgorithmName property.

Examples


public void SampleCreateAsymmetricKeyPair(
    String strAsymmetricAlgName,
    UInt32 keyLength,
    out IBuffer buffPublicKey)
{
    // Open the algorithm provider for the specified asymmetric algorithm.
    AsymmetricKeyAlgorithmProvider objAlgProv = AsymmetricKeyAlgorithmProvider.OpenAlgorithm(strAsymmetricAlgName);

    // Demonstrate use of the AlgorithmName property (not necessary to create a key pair).
    String strAlgName = objAlgProv.AlgorithmName;

    // Create an asymmetric key pair.
    CryptographicKey keyPair = objAlgProv.CreateKeyPair(keyLength);

    // Export the public key to a buffer for use by others.
    buffPublicKey = keyPair.ExportPublicKey();

    // You should keep your private key (embedded in the key pair) secure. For  
    // the purposes of this example, however, we're just copying it into a
    // static class variable for later use during decryption.
    AsymmetricKeyAlgorithmApp.buffKeyPair = keyPair.Export();
}


Requirements (Windows 10 device family)

Device family

Universal

API contract

Windows.Foundation.UniversalApiContract, introduced version 1.0

Namespace

Windows.Security.Cryptography.Core
Windows::Security::Cryptography::Core [C++]

Metadata

Windows.Foundation.UniversalApiContract.winmd

Requirements (Windows 8.x and Windows Phone 8.x)

Minimum supported client

Windows 8

Minimum supported server

Windows Server 2012

Minimum supported phone

Windows Phone 8.1 [Windows Runtime apps only]

Namespace

Windows.Security.Cryptography.Core
Windows::Security::Cryptography::Core [C++]

Metadata

Windows.winmd

See also

AsymmetricKeyAlgorithmProvider

 

 

Show:
© 2015 Microsoft