KeyAlgorithmNames Klasse

Definition

Definiert mehrere häufig verwendete Algorithmennamen für öffentliche Schlüssel. Sie können diese Klasse in der KeyAlgorithmName-Eigenschaft für die CertificateRequestProperties-Klasse verwenden.

public ref class KeyAlgorithmNames abstract sealed
/// [Windows.Foundation.Metadata.ContractVersion(Windows.Foundation.UniversalApiContract, 65536)]
/// [Windows.Foundation.Metadata.MarshalingBehavior(Windows.Foundation.Metadata.MarshalingType.Agile)]
/// [Windows.Foundation.Metadata.Threading(Windows.Foundation.Metadata.ThreadingModel.Both)]
class KeyAlgorithmNames final
[Windows.Foundation.Metadata.ContractVersion(typeof(Windows.Foundation.UniversalApiContract), 65536)]
[Windows.Foundation.Metadata.MarshalingBehavior(Windows.Foundation.Metadata.MarshalingType.Agile)]
[Windows.Foundation.Metadata.Threading(Windows.Foundation.Metadata.ThreadingModel.Both)]
public static class KeyAlgorithmNames
Public Class KeyAlgorithmNames
Vererbung
Object Platform::Object IInspectable KeyAlgorithmNames
Attribute

Windows-Anforderungen

Gerätefamilie
Windows 10 (eingeführt in 10.0.10240.0)
API contract
Windows.Foundation.UniversalApiContract (eingeführt in v1.0)

Beispiele

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

Hinweise

Diese Klasse enthält nur statische Eigenschaften. Sie müssen keine instance der -Klasse erstellen, um die Eigenschaften abzurufen. Verwenden Sie stattdessen den Klassennamen gefolgt vom Punktoperator (.), gefolgt vom Eigenschaftennamen.

Eigenschaften

Dsa

Gibt "DSA" als Schlüsselalgorithmusnamen zurück.

Ecdh

Gibt "ECDH" als Schlüsselalgorithmusnamen zurück.

Ecdh256

Gibt "ECDH256" als Namen des Schlüsselalgorithmus zurück.

Ecdh384

Gibt "ECDH384" als Schlüsselalgorithmusnamen zurück.

Ecdh521

Gibt "ECDH521" als Schlüsselalgorithmusnamen zurück.

Ecdsa

Gibt "ECDSA" als Schlüsselalgorithmusnamen zurück.

Ecdsa256

Gibt "ECDSA256" als Schlüsselalgorithmusnamen zurück.

Ecdsa384

Gibt "ECDSA384" als Namen des Schlüsselalgorithmus zurück.

Ecdsa521

Gibt "ECDSA521" als Namen des Schlüsselalgorithmus zurück.

Rsa

Gibt "RSA" als Schlüsselalgorithmusnamen zurück.

Gilt für:

Weitere Informationen