CertificateRequestProperties
CertificateRequestProperties
CertificateRequestProperties
CertificateRequestProperties
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// You can use this class in JavaScript.
- Attributes
| Device family |
Windows 10 (introduced v10.0.10240.0)
|
| API contract |
Windows.Foundation.UniversalApiContract (introduced v1)
|
Constructors
CertificateRequestProperties() CertificateRequestProperties() CertificateRequestProperties() CertificateRequestProperties()
Creates and initializes a new instance of the CertificateRequestProperties.
public : CertificateRequestProperties()public CertificateRequestProperties()Public Sub New()// You can use this method in JavaScript.
Remarks
This method sets the following default values.
| Property | Default 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 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// You can use this property in JavaScript.
The CA exchange certificate that is used to encrypt a key attestation certificate request.
ContainerName 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// You can use this property in JavaScript.
- Value
- PlatForm::String string string string
The container name.
ContainerNamePrefix 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// You can use this property in JavaScript.
- Value
- PlatForm::String string string string
The prefix of the container name.
CurveName 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// You can use this property in JavaScript.
- Value
- PlatForm::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[]// You can use this property in JavaScript.
- 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// You can use this property in JavaScript.
Specifies whether the key can be exported.
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;
}
Remarks
By default, the private key is not exportable.
Extensions Extensions Extensions Extensions
Gets a vector of certificate extensions.
public : IVector<CertificateExtension> Extensions { get; }public IList<CertificateExtension> Extensions { get; }Public ReadOnly Property Extensions As IList<CertificateExtension>// You can use this property in JavaScript.
- Value
- IVector<CertificateExtension> IList<CertificateExtension> IList<CertificateExtension> IList<CertificateExtension>
A vector of certificate extensions.
| Device family |
Windows 10 Creators Update (introduced v10.0.15063.0)
|
| API contract |
Windows.Foundation.UniversalApiContract (introduced v4)
|
FriendlyName 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// You can use this property in JavaScript.
- Value
- PlatForm::String string string string
The display name.
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;
}
Remarks
By default, this value is an empty string. FriendlyName
HashAlgorithmName 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// You can use this property in JavaScript.
- Value
- PlatForm::String string string string
Hash algorithm.
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;
}
Remarks
The default value is SHA256.
KeyAlgorithmName 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// You can use this property in JavaScript.
- Value
- PlatForm::String string string string
Algorithm name.
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;
}
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.
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// You can use this property in JavaScript.
Strong key protection level.
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;
}
Remarks
The default KeyProtectionLevel value is NoConsent. By default, therefore, strong key protection is not specified.
KeySize KeySize KeySize KeySize
Gets or sets the size, in bits, of the private key to be generated.
public : unsigned int KeySize { get; set; }public uint KeySize { get; set; }Public ReadWrite Property KeySize As uint// You can use this property in JavaScript.
- Value
- unsigned int uint uint uint
The size, in bits, of the private key.
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;
}
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.
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 : PlatForm::String KeyStorageProviderName { get; set; }public string KeyStorageProviderName { get; set; }Public ReadWrite Property KeyStorageProviderName As string// You can use this property in JavaScript.
- Value
- PlatForm::String string string string
The KSP name. The default value is "Microsoft Software Key Storage Provider".
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;
}
Remarks
The name of a cryptographic service provider (CSP) cannot be used.
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// You can use this property in JavaScript.
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.
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// You can use this property in JavaScript.
The certificate used to sign the certificate request.
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 : PlatForm::String SmartcardReaderName { get; set; }public string SmartcardReaderName { get; set; }Public ReadWrite Property SmartcardReaderName As string// You can use this property in JavaScript.
- Value
- PlatForm::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 : PlatForm::String Subject { get; set; }public string Subject { get; set; }Public ReadWrite Property Subject As string// You can use this property in JavaScript.
- Value
- PlatForm::String string string string
The X.500 distinguished name (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;
}
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.
SubjectAlternativeName SubjectAlternativeName SubjectAlternativeName SubjectAlternativeName
Gets the subject alternative name.
public : SubjectAlternativeNameInfo SubjectAlternativeName { get; }public SubjectAlternativeNameInfo SubjectAlternativeName { get; }Public ReadOnly Property SubjectAlternativeName As SubjectAlternativeNameInfo// You can use this property in JavaScript.
- Value
- SubjectAlternativeNameInfo SubjectAlternativeNameInfo SubjectAlternativeNameInfo SubjectAlternativeNameInfo
The subject alternative name.
| Device family |
Windows 10 Creators Update (introduced v10.0.15063.0)
|
| API contract |
Windows.Foundation.UniversalApiContract (introduced v4)
|
SuppressedDefaults SuppressedDefaults SuppressedDefaults SuppressedDefaults
Gets a vector of suppressed defaults.
public : IVector<string> SuppressedDefaults { get; }public IList<string> SuppressedDefaults { get; }Public ReadOnly Property SuppressedDefaults As IList<string>// You can use this property in JavaScript.
- Value
- IVector<PlatForm::String> IList<string> IList<string> IList<string>
A vector of suppressed defaults.
| Device family |
Windows 10 Creators Update (introduced v10.0.15063.0)
|
| API contract |
Windows.Foundation.UniversalApiContract (introduced v4)
|
UseExistingKey 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// You can use this property in JavaScript.
- Value
- PlatForm::Boolean bool bool bool
True if using the existing key; otherwise, false.