KeyAlgorithmNames 클래스

정의

일반적으로 사용되는 몇 가지 공개 키 알고리즘 이름을 정의합니다. CertificateRequestProperties 클래스의 KeyAlgorithmName 속성에서 이 클래스를 사용할 수 있습니다.

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
상속
Object Platform::Object IInspectable KeyAlgorithmNames
특성

Windows 요구 사항

디바이스 패밀리
Windows 10 (10.0.10240.0에서 도입되었습니다.)
API contract
Windows.Foundation.UniversalApiContract (v1.0에서 도입되었습니다.)

예제

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

설명

이 클래스에는 정적 속성만 포함됩니다. 속성을 검색하기 위해 클래스의 instance 만들 필요가 없습니다. 대신 클래스 이름 뒤에 점 연산자(.) 뒤에 속성 이름을 사용합니다.

속성

Dsa

키 알고리즘 이름으로 "DSA"를 반환합니다.

Ecdh

키 알고리즘 이름으로 "ECDH"를 반환합니다.

Ecdh256

키 알고리즘 이름으로 "ECDH256"을 반환합니다.

Ecdh384

키 알고리즘 이름으로 "ECDH384"를 반환합니다.

Ecdh521

키 알고리즘 이름으로 "ECDH521"을 반환합니다.

Ecdsa

키 알고리즘 이름으로 "ECDSA"를 반환합니다.

Ecdsa256

키 알고리즘 이름으로 "ECDSA256"을 반환합니다.

Ecdsa384

키 알고리즘 이름으로 "ECDSA384"를 반환합니다.

Ecdsa521

키 알고리즘 이름으로 "ECDSA521"을 반환합니다.

Rsa

키 알고리즘 이름으로 "RSA"를 반환합니다.

적용 대상

추가 정보