KeyAlgorithmNames Classe

Definizione

Definisce diversi nomi di algoritmi di chiave pubblica comunemente usati. È possibile usare questa classe nella proprietà KeyAlgorithmName nella classe CertificateRequestProperties .

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
Ereditarietà
Object Platform::Object IInspectable KeyAlgorithmNames
Attributi

Requisiti Windows

Famiglia di dispositivi
Windows 10 (è stato introdotto in 10.0.10240.0)
API contract
Windows.Foundation.UniversalApiContract (è stato introdotto in v1.0)

Esempio

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

Commenti

Questa classe contiene solo proprietà statiche. Non è necessario creare un'istanza della classe per recuperare le proprietà. Usare invece il nome della classe seguito dall'operatore dot (.), seguito dal nome della proprietà.

Proprietà

Dsa

Restituisce "DSA" come nome dell'algoritmo di chiave.

Ecdh

Restituisce "ECDH" come nome dell'algoritmo di chiave.

Ecdh256

Restituisce "ECDH256" come nome dell'algoritmo chiave.

Ecdh384

Restituisce "ECDH384" come nome dell'algoritmo di chiave.

Ecdh521

Restituisce "ECDH521" come nome dell'algoritmo di chiave.

Ecdsa

Restituisce "ECDSA" come nome dell'algoritmo di chiave.

Ecdsa256

Restituisce "ECDSA256" come nome dell'algoritmo di chiave.

Ecdsa384

Restituisce "ECDSA384" come nome dell'algoritmo di chiave.

Ecdsa521

Restituisce "ECDSA521" come nome dell'algoritmo di chiave.

Rsa

Restituisce "RSA" come nome dell'algoritmo chiave.

Si applica a

Vedi anche