共用方式為


CertificateRequestProperties.KeyUsages 屬性

定義

取得或設定可由為此憑證要求建立的私密金鑰所執行的作業。 預設值為 [簽署]。

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

屬性值

私密金鑰使用方式。

範例

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

備註

預設金鑰使用值是 [簽署]。

適用於