Delen via


CertificateRequestProperties.KeyUsages Property

Definition

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

public:
 property EnrollKeyUsages KeyUsages { EnrollKeyUsages get(); void set(EnrollKeyUsages value); };
EnrollKeyUsages KeyUsages();

void KeyUsages(EnrollKeyUsages value);
public EnrollKeyUsages KeyUsages { get; set; }
var enrollKeyUsages = certificateRequestProperties.keyUsages;
certificateRequestProperties.keyUsages = enrollKeyUsages;
Public Property KeyUsages As EnrollKeyUsages

Property Value

Private key usage.

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

Remarks

The default key usage value is Signing.

Applies to