CertificateRequestProperties.KeyUsages 属性
定义
重要
一些信息与预发行产品相关,相应产品在发行之前可能会进行重大修改。 对于此处提供的信息,Microsoft 不作任何明示或暗示的担保。
获取或设置可由为此证书请求创建的私钥执行的操作。 默认值为 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
属性值
私钥用法。
示例
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;
}
注解
默认密钥用法值为 Signing。