CertificateRequestProperties CertificateRequestProperties CertificateRequestProperties CertificateRequestProperties Class

Represents the properties of a certificate request.

Syntax

Declaration

public sealed class CertificateRequestPropertiespublic sealed class CertificateRequestPropertiesPublic NotInheritable Class CertificateRequestProperties

Constructors summary

Creates and initializes a new instance of the CertificateRequestProperties.

Properties summary

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

Gets or sets the container name.

Gets or sets the prefix of the container name.

Gets or sets the name of the elliptic curve.

Gets or sets the parameters of the elliptic curve.

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

Gets or sets the display name of the enrolled certificate.

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

Gets or sets the public key algorithm.

Gets or sets the level of strong key protection.

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

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

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

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

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

Gets or sets the subject name.

Gets or sets whether to use the existing key.

Constructors

Properties

  • AttestationCredentialCertificate
    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

    Property Value

  • ContainerName
    ContainerName
    ContainerName
    ContainerName

    Gets or sets the container name.

    public string ContainerName { get; set; }public string ContainerName { get; set; }Public ReadWrite Property ContainerName As string

    Property Value

    • string
      string
      string
      string

      The container name.

  • ContainerNamePrefix
    ContainerNamePrefix
    ContainerNamePrefix
    ContainerNamePrefix

    Gets or sets the prefix of the container name.

    public string ContainerNamePrefix { get; set; }public string ContainerNamePrefix { get; set; }Public ReadWrite Property ContainerNamePrefix As string

    Property Value

    • string
      string
      string
      string

      The prefix of the container name.

  • CurveName
    CurveName
    CurveName
    CurveName

    Gets or sets the name of the elliptic curve.

    public string CurveName { get; set; }public string CurveName { get; set; }Public ReadWrite Property CurveName As string

    Property Value

    • string
      string
      string
      string

      The name of the elliptic curve.

  • CurveParameters
    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[]

    Property Value

    • byte[]
      byte[]
      byte[]
      byte[]

      The parameters of the elliptic curve.

  • Exportable
    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

    Property Value

    Remarks

    By default, the private key is not exportable.

    Examples

    [!code-csharpShowExportable]

  • FriendlyName
    FriendlyName
    FriendlyName
    FriendlyName

    Gets or sets the display name of the enrolled certificate.

    public string FriendlyName { get; set; }public string FriendlyName { get; set; }Public ReadWrite Property FriendlyName As string

    Property Value

    • string
      string
      string
      string

      The display name.

    Remarks

    By default, this value is an empty string.

    Examples

    [!code-csharpShowDisplayName]

  • HashAlgorithmName
    HashAlgorithmName
    HashAlgorithmName
    HashAlgorithmName

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

    public string HashAlgorithmName { get; set; }public string HashAlgorithmName { get; set; }Public ReadWrite Property HashAlgorithmName As string

    Property Value

    • string
      string
      string
      string

      Hash algorithm.

    Remarks

    The default value is SHA256.

    Examples

    [!code-csharpShowHashAlg]

  • KeyAlgorithmName
    KeyAlgorithmName
    KeyAlgorithmName
    KeyAlgorithmName

    Gets or sets the public key algorithm.

    public string KeyAlgorithmName { get; set; }public string KeyAlgorithmName { get; set; }Public ReadWrite Property KeyAlgorithmName As string

    Property Value

    • string
      string
      string
      string

      Algorithm name.

    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

    [!code-csharpShowPublicKeyAlg]

  • KeyProtectionLevel
    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

    Property Value

    Remarks

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

    Examples

    [!code-csharpShowProtectionLevel]

  • KeySize
    KeySize
    KeySize
    KeySize

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

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

    Property Value

    • uint
      uint
      uint
      uint

      The size, in bits, of the private key.

    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

    [!code-csharpShowKeySize]

  • KeyStorageProviderName
    KeyStorageProviderName
    KeyStorageProviderName
    KeyStorageProviderName

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

    public string KeyStorageProviderName { get; set; }public string KeyStorageProviderName { get; set; }Public ReadWrite Property KeyStorageProviderName As string

    Property Value

    • string
      string
      string
      string

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

    Remarks

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

    Examples

    [!code-csharpShowKspName]

  • KeyUsages
    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

    Property Value

    Remarks

    The default key usage value is Signing.

    Examples

    [!code-csharpShowKeyUsages]

  • SigningCertificate
    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

    Property Value

    Remarks

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

  • SmartcardReaderName
    SmartcardReaderName
    SmartcardReaderName
    SmartcardReaderName

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

    public string SmartcardReaderName { get; set; }public string SmartcardReaderName { get; set; }Public ReadWrite Property SmartcardReaderName As string

    Property Value

    • string
      string
      string
      string

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

  • Subject
    Subject
    Subject
    Subject

    Gets or sets the subject name.

    public string Subject { get; set; }public string Subject { get; set; }Public ReadWrite Property Subject As string

    Property Value

    • string
      string
      string
      string

      The X.500 distinguished name (DN).

    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

    [!code-csharpShowSubjectName]

  • UseExistingKey
    UseExistingKey
    UseExistingKey
    UseExistingKey

    Gets or sets whether to use the existing key.

    public bool UseExistingKey { get; set; }public bool UseExistingKey { get; set; }Public ReadWrite Property UseExistingKey As bool

    Property Value

    • bool
      bool
      bool
      bool

      True if using the existing key; otherwise, false.

Device family

Windows 10 (introduced v10.0.10240.0)

API contract

Windows.Foundation.UniversalApiContract (introduced v1)

Attributes

Windows.Foundation.Metadata.ThreadingAttribute
Windows.Foundation.Metadata.ActivatableAttribute
Windows.Foundation.Metadata.ContractVersionAttribute
Windows.Foundation.Metadata.MarshalingBehaviorAttribute
Windows.Foundation.Metadata.DualApiPartitionAttribute

Details

Assembly

Windows.Security.Cryptography.Certificates.dll