CertificateRequestProperties.KeyProtectionLevel 属性

定义

获取或设置强密钥保护的级别。

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

void KeyProtectionLevel(KeyProtectionLevel value);
public KeyProtectionLevel KeyProtectionLevel { get; set; }
var keyProtectionLevel = certificateRequestProperties.keyProtectionLevel;
certificateRequestProperties.keyProtectionLevel = keyProtectionLevel;
Public Property KeyProtectionLevel As KeyProtectionLevel

属性值

强大的密钥保护级别。

示例

public KeyProtectionLevel GetSetKeyProtectionLevel(KeyProtectionLevel levelIn)
{
    // Create a new CertificateRequestProperties object.
    CertificateRequestProperties reqProperties = new CertificateRequestProperties();

    // The default value is NoConsent.
    KeyProtectionLevel defaultLevel = reqProperties.KeyProtectionLevel;

    // If the input option does not equal the default option, reset the property value.
    if (levelIn != defaultLevel)
    {
        reqProperties.KeyProtectionLevel = levelIn;
    }

    // return the key protection level.
    return reqProperties.KeyProtectionLevel;
}

注解

默认 KeyProtectionLevel 值为 NoConsent。 因此,默认情况下未指定强密钥保护。

适用于