Certificate​Request​Properties Certificate​Request​Properties Certificate​Request​Properties Class

Definition

Represents the properties of a certificate request.

public sealed class CertificateRequestProperties : ICertificateRequestProperties, ICertificateRequestProperties2, ICertificateRequestProperties3, ICertificateRequestProperties4public sealed class CertificateRequestProperties : ICertificateRequestProperties, ICertificateRequestProperties2, ICertificateRequestProperties3, ICertificateRequestProperties4Public NotInheritable Class CertificateRequestProperties Implements ICertificateRequestProperties, ICertificateRequestProperties2, ICertificateRequestProperties3, ICertificateRequestProperties4
Attributes
Windows 10 requirements
Device family
Windows 10 (introduced v10.0.10240.0)
API contract
Windows.Foundation.UniversalApiContract (introduced v1)

Constructors

CertificateRequestProperties() CertificateRequestProperties() CertificateRequestProperties()

Creates and initializes a new instance of the CertificateRequestProperties.

public CertificateRequestProperties()public CertificateRequestProperties()Public Sub New()
Attributes

Remarks

This method sets the following default values.

PropertyDefault value
Subject Empty string
KeyAlgorithmName RSA
KeySize 2048 bits
FriendlyName Empty String
HashAlgorithmName SHA256
Exportable Not Exportable
KeyUsages Signing
KeyProtectionLevel NoConsent
KeyStorageProviderName Microsoft Software Key Storage Provider

Properties

AttestationCredentialCertificate AttestationCredentialCertificate AttestationCredentialCertificate

Gets or sets the CA exchange certificate that is used to encrypt a key attestation certificate request.

public Certificate AttestationCredentialCertificate { get; set; }public Certificate AttestationCredentialCertificate { get; set; }Public ReadWrite Property AttestationCredentialCertificate As Certificate
Value
Certificate Certificate Certificate

The CA exchange certificate that is used to encrypt a key attestation certificate request.

Attributes

ContainerName ContainerName ContainerName

Gets or sets the container name.

public PlatForm::String ContainerName { get; set; }public string ContainerName { get; set; }Public ReadWrite Property ContainerName As string
Value
string string string

The container name.

Attributes

ContainerNamePrefix ContainerNamePrefix ContainerNamePrefix

Gets or sets the prefix of the container name.

public PlatForm::String ContainerNamePrefix { get; set; }public string ContainerNamePrefix { get; set; }Public ReadWrite Property ContainerNamePrefix As string
Value
string string string

The prefix of the container name.

Attributes

CurveName CurveName CurveName

Gets or sets the name of the elliptic curve.

public PlatForm::String CurveName { get; set; }public string CurveName { get; set; }Public ReadWrite Property CurveName As string
Value
string string string

The name of the elliptic curve.

Attributes

CurveParameters CurveParameters CurveParameters

Gets or sets the parameters of the elliptic curve.

public byte[] CurveParameters { get; set; }public byte[] CurveParameters { get; set; }Public ReadWrite Property CurveParameters As byte[]
Value
byte[] byte[] byte[]

The parameters of the elliptic curve.

Attributes

Exportable Exportable Exportable

Gets or sets a value that specifies whether the private key created for the request can be exported.

public ExportOption Exportable { get; set; }public ExportOption Exportable { get; set; }Public ReadWrite Property Exportable As ExportOption
Value
ExportOption ExportOption ExportOption

Specifies whether the key can be exported.

Attributes

Remarks

By default, the private key is not exportable.

Examples

public ExportOption GetSetExportable(ExportOption inputOption)
{
    // Create a new CertificateRequestProperties object.
    CertificateRequestProperties reqProperties = new CertificateRequestProperties();
    
    // The default value is ExportOption.NotExportable
    ExportOption defaultOption = reqProperties.Exportable;

    // If the input option does not equal the default option, reset the property value.
    if (inputOption != defaultOption)
    {
        reqProperties.Exportable = inputOption;
    }

    // Return the option value.
    return reqProperties.Exportable;
}

Extensions Extensions Extensions

Gets a vector of certificate extensions.

public IVector<CertificateExtension> Extensions { get; }public IVector<CertificateExtension> Extensions { get; }Public ReadOnly Property Extensions As IVector<CertificateExtension>
Value

A vector of certificate extensions.

Attributes
Additional features and requirements
Device family
Windows 10 Creators Update (introduced v10.0.15063.0)
API contract
Windows.Foundation.UniversalApiContract (introduced v4)

FriendlyName FriendlyName FriendlyName

Gets or sets the display name of the enrolled certificate.

public PlatForm::String FriendlyName { get; set; }public string FriendlyName { get; set; }Public ReadWrite Property FriendlyName As string
Value
string string string

The display name.

Attributes

Remarks

By default, this value is an empty string. FriendlyName

Examples

public String GetSetDisplayName(String strDisplayNameIn)
{
    // Create a new CertificateRequestProperties object.
    CertificateRequestProperties reqProperties = new CertificateRequestProperties();
    
    // The default value is an empty string.
    String defaultName = reqProperties.FriendlyName;

    // If the input option does not equal the default option, reset the property value.
    if (strDisplayNameIn != defaultName)
    {
        reqProperties.FriendlyName = strDisplayNameIn;
    }

    // Return the display name.
    return reqProperties.FriendlyName;

}

HashAlgorithmName HashAlgorithmName HashAlgorithmName

Gets or sets the hash algorithm used when creating the certificate request signature.

public PlatForm::String HashAlgorithmName { get; set; }public string HashAlgorithmName { get; set; }Public ReadWrite Property HashAlgorithmName As string
Value
string string string

Hash algorithm.

Attributes

Remarks

The default value is SHA256.

Examples

public String GetSetHashAlgorithm(String strAlgNameIn)
{
    // Create a new CertificateRequestProperties object.
    CertificateRequestProperties reqProperties = new CertificateRequestProperties();

    // The default value is SHA256.
    String strDefaultAlgName = reqProperties.HashAlgorithmName;

    // If the input option does not equal the default option, reset the property value.
    if (strAlgNameIn != strDefaultAlgName)
    {
        reqProperties.HashAlgorithmName = strAlgNameIn;
    }

    // Return the algorithm name.
    return reqProperties.HashAlgorithmName;
}

KeyAlgorithmName KeyAlgorithmName KeyAlgorithmName

Gets or sets the public key algorithm.

public PlatForm::String KeyAlgorithmName { get; set; }public string KeyAlgorithmName { get; set; }Public ReadWrite Property KeyAlgorithmName As string
Value
string string string

Algorithm name.

Attributes

Remarks

The default value is "RSA". You can use properties on the KeyAlgorithmNames class to specify error-free names or to compare the name retrieved by this property with a known string.

Examples

public String GetSetPublicKeyAlgorithm(String strAlgNameIn)
{
    // Create a new CertificateRequestProperties object.
    CertificateRequestProperties reqProperties = new CertificateRequestProperties();

    // The default value is RSA.
    String strDefaultAlgName = reqProperties.KeyAlgorithmName;

    // If the input option does not equal the default option, reset the property value.
    if (strAlgNameIn != strDefaultAlgName)
    {
        reqProperties.KeyAlgorithmName = strAlgNameIn;
    }

    // Return the algorithm name.
    return reqProperties.KeyAlgorithmName;
}

KeyProtectionLevel KeyProtectionLevel KeyProtectionLevel

Gets or sets the level of strong key protection.

public KeyProtectionLevel KeyProtectionLevel { get; set; }public KeyProtectionLevel KeyProtectionLevel { get; set; }Public ReadWrite Property KeyProtectionLevel As KeyProtectionLevel
Value
KeyProtectionLevel KeyProtectionLevel KeyProtectionLevel

Strong key protection level.

Attributes

Remarks

The default KeyProtectionLevel value is NoConsent. By default, therefore, strong key protection is not specified.

Examples

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

KeySize KeySize KeySize

Gets or sets the size, in bits, of the private key to be generated.

public unsigned short KeySize { get; set; }public uint KeySize { get; set; }Public ReadWrite Property KeySize As uint
Value
uint uint uint

The size, in bits, of the private key.

Attributes

Remarks

The default key size for RSA and DSA algorithms is 2048 bits. If an elliptic curve cryptographic (ECC) algorithm was specified in the KeyAlgorithmName property, the key size is ignored.

Examples

public UInt32 GetSetKeySize(UInt32 sizeIn)
{
    // Create a new CertificateRequestProperties object.
    CertificateRequestProperties reqProperties = new CertificateRequestProperties();

    // The default value is 2048 bits.
    UInt32 uDefaultSize = reqProperties.KeySize;

    // If the input option does not equal the default option, reset the property value.
    if (SizeIn != uDefaultSize)
    {
        reqProperties.KeySize = SizeIn;
    }

    // Return the key size.
    return reqProperties.KeySize;
}

KeyStorageProviderName KeyStorageProviderName KeyStorageProviderName

Gets or sets the name of the key storage provider (KSP) that will be used to generate the private key.

public PlatForm::String KeyStorageProviderName { get; set; }public string KeyStorageProviderName { get; set; }Public ReadWrite Property KeyStorageProviderName As string
Value
string string string

The KSP name. The default value is "Microsoft Software Key Storage Provider".

Attributes

Remarks

The name of a cryptographic service provider (CSP) cannot be used.

Examples

public String GetSetKspName(String strNameIn)
{
    // Create a new CertificateRequestProperties object.
    CertificateRequestProperties reqProperties = new CertificateRequestProperties();

    // The default value is Microsoft Software Key Storage Provider.
    String strDefaultName = reqProperties.KeyStorageProviderName;

    // If the input option does not equal the default option, reset the property value.
    if (strNameIn != strDefaultName)
    {
        reqProperties.KeyStorageProviderName = strNameIn;
    }

    // Return the KSP name.
    return reqProperties.KeyStorageProviderName;
}

KeyUsages KeyUsages KeyUsages

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

public EnrollKeyUsages KeyUsages { get; set; }public EnrollKeyUsages KeyUsages { get; set; }Public ReadWrite Property KeyUsages As EnrollKeyUsages
Attributes

Remarks

The default key usage value is Signing.

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

SigningCertificate SigningCertificate SigningCertificate

Gets or sets the certificate used to sign the certificate request.

public Certificate SigningCertificate { get; set; }public Certificate SigningCertificate { get; set; }Public ReadWrite Property SigningCertificate As Certificate
Value
Certificate Certificate Certificate

The certificate used to sign the certificate request.

Attributes

Remarks

The output of a signed request is a PKCS7 X509 certificate request.

SmartcardReaderName SmartcardReaderName SmartcardReaderName

Gets or sets the name of the smart card reader used to create the certificate request.

public PlatForm::String SmartcardReaderName { get; set; }public string SmartcardReaderName { get; set; }Public ReadWrite Property SmartcardReaderName As string
Value
string string string

The name of the smart card reader used to create the certificate request.

Attributes

Subject Subject Subject

Gets or sets the subject name.

public PlatForm::String Subject { get; set; }public string Subject { get; set; }Public ReadWrite Property Subject As string
Value
string string string

The X.500 distinguished name (DN).

Attributes

Remarks

This value is an X.500 distinguished name (DN). This can be a full DN string that contains one or more relative distinguished names (RDNs) in the format of "CN=;OU=,..", or the subject name can be a simple string that contains the common name (CN) component of the full DN.

Examples

public String GetSetSubjectName(String strNameIn)
{
    // Create a new CertificateRequestProperties object.
    CertificateRequestProperties reqProperties = new CertificateRequestProperties();

    // The default value is an empty string.
    String strDefaultName = reqProperties.Subject;

    // If the input option does not equal the default option, reset the property value.
    if (strNameIn != strDefaultName)
    {
        reqProperties.Subject = strNameIn;
    }

    // Return the subject name.
    return reqProperties.Subject;
}

SubjectAlternativeName SubjectAlternativeName SubjectAlternativeName

Gets the subject alternative name.

public SubjectAlternativeNameInfo SubjectAlternativeName { get; }public SubjectAlternativeNameInfo SubjectAlternativeName { get; }Public ReadOnly Property SubjectAlternativeName As SubjectAlternativeNameInfo
Attributes
Additional features and requirements
Device family
Windows 10 Creators Update (introduced v10.0.15063.0)
API contract
Windows.Foundation.UniversalApiContract (introduced v4)

SuppressedDefaults SuppressedDefaults SuppressedDefaults

Gets a vector of suppressed defaults.

public IVector<string> SuppressedDefaults { get; }public IVector<string> SuppressedDefaults { get; }Public ReadOnly Property SuppressedDefaults As IVector<string>
Value

A vector of suppressed defaults.

Attributes
Additional features and requirements
Device family
Windows 10 Creators Update (introduced v10.0.15063.0)
API contract
Windows.Foundation.UniversalApiContract (introduced v4)

UseExistingKey UseExistingKey UseExistingKey

Gets or sets whether to use the existing key.

public PlatForm::Boolean UseExistingKey { get; set; }public bool UseExistingKey { get; set; }Public ReadWrite Property UseExistingKey As bool
Value
bool bool bool

True if using the existing key; otherwise, false.

Attributes