KeyAlgorithmNames KeyAlgorithmNames KeyAlgorithmNames KeyAlgorithmNames Class

Definition

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

public static class KeyAlgorithmNamespublic static class KeyAlgorithmNamesPublic Static Class KeyAlgorithmNamespublic static class KeyAlgorithmNames
Attributes
Windows 10 requirements
Device family
Windows 10 (introduced v10.0.10240.0)
API contract
Windows.Foundation.UniversalApiContract (introduced v1)

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;
        }
    }
}

Properties

Dsa Dsa Dsa Dsa

Returns "DSA" as the key algorithm name.

public static string Dsa { get; }public static string Dsa { get; }Public Static ReadOnly Property Dsa As stringpublic static string Dsa { get; }
Value
string string string string

The key algorithm name.

Attributes
Additional features and requirements
Device family
Windows 10 (introduced v10.0.10240.0)
API contract
Windows.Foundation.UniversalApiContract (introduced v1)

Ecdh Ecdh Ecdh Ecdh

Returns "ECDH" as the key algorithm name.

public static string Ecdh { get; }public static string Ecdh { get; }Public Static ReadOnly Property Ecdh As stringpublic static string Ecdh { get; }
Value
string string string string

The key algorithm name.

Attributes
Additional features and requirements
Device family
Windows 10 (introduced v10.0.10240.0)
API contract
Windows.Foundation.UniversalApiContract (introduced v1)

Ecdh256 Ecdh256 Ecdh256 Ecdh256

Returns "ECDH256" as the key algorithm name.

public static string Ecdh256 { get; }public static string Ecdh256 { get; }Public Static ReadOnly Property Ecdh256 As stringpublic static string Ecdh256 { get; }
Value
string string string string

The key algorithm name.

Attributes
Additional features and requirements
Device family
Windows 10 (introduced v10.0.10240.0)
API contract
Windows.Foundation.UniversalApiContract (introduced v1)

Ecdh384 Ecdh384 Ecdh384 Ecdh384

Returns "ECDH384" as the key algorithm name.

public static string Ecdh384 { get; }public static string Ecdh384 { get; }Public Static ReadOnly Property Ecdh384 As stringpublic static string Ecdh384 { get; }
Value
string string string string

The key algorithm name.

Attributes
Additional features and requirements
Device family
Windows 10 (introduced v10.0.10240.0)
API contract
Windows.Foundation.UniversalApiContract (introduced v1)

Ecdh521 Ecdh521 Ecdh521 Ecdh521

Returns "ECDH521" as the key algorithm name.

public static string Ecdh521 { get; }public static string Ecdh521 { get; }Public Static ReadOnly Property Ecdh521 As stringpublic static string Ecdh521 { get; }
Value
string string string string

The key algorithm name.

Attributes
Additional features and requirements
Device family
Windows 10 (introduced v10.0.10240.0)
API contract
Windows.Foundation.UniversalApiContract (introduced v1)

Remarks

Examples

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;
}

Ecdsa Ecdsa Ecdsa Ecdsa

Returns "ECDSA" as the key algorithm name.

public static string Ecdsa { get; }public static string Ecdsa { get; }Public Static ReadOnly Property Ecdsa As stringpublic static string Ecdsa { get; }
Value
string string string string

The key algorithm name.

Attributes
Additional features and requirements
Device family
Windows 10 (introduced v10.0.10240.0)
API contract
Windows.Foundation.UniversalApiContract (introduced v1)

Ecdsa256 Ecdsa256 Ecdsa256 Ecdsa256

Returns "ECDSA256" as the key algorithm name.

public static string Ecdsa256 { get; }public static string Ecdsa256 { get; }Public Static ReadOnly Property Ecdsa256 As stringpublic static string Ecdsa256 { get; }
Value
string string string string

The key algorithm name.

Attributes
Additional features and requirements
Device family
Windows 10 (introduced v10.0.10240.0)
API contract
Windows.Foundation.UniversalApiContract (introduced v1)

Ecdsa384 Ecdsa384 Ecdsa384 Ecdsa384

Returns "ECDSA384" as the key algorithm name.

public static string Ecdsa384 { get; }public static string Ecdsa384 { get; }Public Static ReadOnly Property Ecdsa384 As stringpublic static string Ecdsa384 { get; }
Value
string string string string

The key algorithm name.

Attributes
Additional features and requirements
Device family
Windows 10 (introduced v10.0.10240.0)
API contract
Windows.Foundation.UniversalApiContract (introduced v1)

Ecdsa521 Ecdsa521 Ecdsa521 Ecdsa521

Returns "ECDSA521" as the key algorithm name.

public static string Ecdsa521 { get; }public static string Ecdsa521 { get; }Public Static ReadOnly Property Ecdsa521 As stringpublic static string Ecdsa521 { get; }
Value
string string string string

The key algorithm name.

Attributes
Additional features and requirements
Device family
Windows 10 (introduced v10.0.10240.0)
API contract
Windows.Foundation.UniversalApiContract (introduced v1)

Rsa Rsa Rsa Rsa

Returns "RSA" as the key algorithm name.

public static string Rsa { get; }public static string Rsa { get; }Public Static ReadOnly Property Rsa As stringpublic static string Rsa { get; }
Value
string string string string

The key algorithm name.

Attributes
Additional features and requirements
Device family
Windows 10 (introduced v10.0.10240.0)
API contract
Windows.Foundation.UniversalApiContract (introduced v1)