CertificateRequestProperties.KeyUsages Property
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
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.