CertificateRequestProperties.KeyUsages | keyUsages property

Applies to Windows and Windows Phone

Gets or sets the operation that can be performed by the private key created for this certificate request. The default value is Signing.

Syntax


var keyUsages = certificateRequestProperties.keyUsages;
certificateRequestProperties.keyUsages = keyUsages;

Property value

Type: EnrollKeyUsages

Private key usage.

Remarks

The default key usage value is Signing.

Examples


public EnrollKeyUsages GetSetKeyUsage(EnrollKeyUsages keyUseIn)
{
    // Create a new CertificateRequestProperties object.
    CertificateRequestProperties reqProperties = new CertificateRequestProperties();

    // The default value is signing.
    EnrollKeyUsages defaultKeyUse = reqProperties.KeyUsages;

    // If the input option does not equal the default option, reset the property value.
    if (keyUseIn != defaultKeyUse)
    {
        reqProperties.KeyUsages = keyUseIn;
    }

    // Return the value.
    return reqProperties.KeyUsages;
}


Requirements

Minimum supported client

Windows 8

Minimum supported server

Windows Server 2012

Minimum supported phone

Windows Phone 8.1 [Windows Runtime apps only]

Namespace

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

Metadata

Windows.winmd

See also

CertificateRequestProperties

 

 

Show:
© 2014 Microsoft