Skip to main content
KeyAlgorithmNames class

Defines several commonly used public key algorithm names. You can use this class in the KeyAlgorithmName property on the CertificateRequestProperties class.

Syntax


var keyAlgorithmNames = Windows.Security.Cryptography.Certificates.KeyAlgorithmNames;

public static class KeyAlgorithmNames

Public NotInheritable Class KeyAlgorithmNames

public ref class KeyAlgorithmNames abstract sealed 

Members

The KeyAlgorithmNames class has these types of members:

Properties

The KeyAlgorithmNames class has these properties.

PropertyAccess typeDescription

Dsa

Read-only

Returns DSA as the key algorithm name.

Ecdh

Read-only

Returns ECDH as the key algorithm name.

Ecdh256

Read-only

Returns ECDH256 as the key algorithm name.

Ecdh384

Read-only

Returns ECDH384 as the key algorithm name.

Ecdh521

Read-only

Returns ECDH521 as the key algorithm name.

Ecdsa

Read-only

Returns ECDSA as the key algorithm name.

Ecdsa256

Read-only

Returns ECDSA256 as the key algorithm name.

Ecdsa384

Read-only

Returns ECDSA384 as the key algorithm name.

Ecdsa521

Read-only

Returns ECDSA521 as the key algorithm name.

Rsa

Read-only

Returns RSA as the key algorithm name.

 

Remarks

This class contains only static properties. You do not have to create an instance of the class to retrieve the properties. Instead, use the class name followed by the dot operator (.), followed by the property name.

Examples


using Windows.Security.Cryptography.Certificates;

namespace SampleKeyAlgorithmNames
{
    sealed partial class KeyAlgNamesApp : Application
    {
        public KeyAlgNamesApp()
        {
            // Initialize the application.
            this.InitializeComponent();

            // Demonstrate how to retrieve and set public key algorithm name.
            this.SamplePublicKeyAlgNames();
        }

        public void SamplePublicKeyAlgNames()
        {
            // Create a new CertificateRequestProperties object.
            CertificateRequestProperties reqProperties = new CertificateRequestProperties();

            // Retrieve the default value (RSA).
            String strDefaultAlgName = reqProperties.KeyAlgorithmName;

            // Set the value to DSA.
            reqProperties.KeyAlgorithmName = KeyAlgorithmNames.Dsa;

            //Set the value to ECDH_P256.
            reqProperties.KeyAlgorithmName = KeyAlgorithmNames.Ecdh256;

            //Set the value to ECDH_P384.
            reqProperties.KeyAlgorithmName = KeyAlgorithmNames.Ecdh384;

            //Set the value to ECDH_P521.
            reqProperties.KeyAlgorithmName = KeyAlgorithmNames.Ecdh521;

            //Set the value to ECDSA_P256.
            reqProperties.KeyAlgorithmName = KeyAlgorithmNames.Ecdsa256;

            //Set the value to ECDSA_P384.
            reqProperties.KeyAlgorithmName = KeyAlgorithmNames.Ecdsa384;

            //Set the value to ECDSA_P521.
            reqProperties.KeyAlgorithmName = KeyAlgorithmNames.Ecdsa521;
        }
    }
}

Requirements (Windows 10 device family)

Device family

Universal, introduced version 10.0.10240.0

API contract

Windows.Foundation.UniversalApiContract, introduced version 1.0

Namespace

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

Metadata

Windows.Foundation.UniversalApiContract.winmd

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

Minimum supported client

Windows 8 [Windows Store apps, desktop apps]

Minimum supported server

Windows Server 2012 [Windows Store apps, desktop apps]

Minimum supported phone

Windows Phone 8.1 [Windows Runtime apps only]

Namespace

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

Metadata

Windows.winmd

Attributes

[ DualApiPartition()]
[ MarshalingBehavior(Agile)]
[ Threading(Both)]
[ Version(0x06020000)]

See also

Object
CertificateRequestProperties
KeyAlgorithmName
Windows.Security.Cryptography.Certificates