Certificate Certificate Certificate Certificate Class

Definition

Represents a cryptography certificate.

public : sealed class Certificate : ICertificate, ICertificate2, ICertificate3public sealed class Certificate : ICertificate, ICertificate2, ICertificate3Public NotInheritable Class Certificate Implements ICertificate, ICertificate2, ICertificate3// You can use this class in JavaScript.
Attributes
Windows 10 requirements
Device family
Windows 10 (introduced v10.0.10240.0)
API contract
Windows.Foundation.UniversalApiContract (introduced v1)

Constructors

Certificate(IBuffer) Certificate(IBuffer) Certificate(IBuffer) Certificate(IBuffer)

Create a new instance of the Certificate class using the specified certificate data.

public : Certificate(IBuffer certBlob)public Certificate(IBuffer certBlob)Public Sub New(certBlob As IBuffer)// You can use this method in JavaScript.
Parameters
certBlob
IBuffer IBuffer IBuffer IBuffer

The certificate data as an ASN.1 DER encoded certificate blob (.cer or .p7b).

Properties

EnhancedKeyUsages EnhancedKeyUsages EnhancedKeyUsages EnhancedKeyUsages

Gets a collection of object identifiers (OIDs) for the enhanced key usage extension.

public : IVectorView<string> EnhancedKeyUsages { get; }public IReadOnlyList<string> EnhancedKeyUsages { get; }Public ReadOnly Property EnhancedKeyUsages As IReadOnlyList<string>// You can use this property in JavaScript.
Value
IVectorView<PlatForm::String> IReadOnlyList<string> IReadOnlyList<string> IReadOnlyList<string>

A collection of object identifiers (OIDs) for the enhanced key usage extension

FriendlyName FriendlyName FriendlyName FriendlyName

Gets or sets the friendly name for the 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 friendly name for the certificate. If the certificate does not have a friendly name set, then an empty string is returned.

HasPrivateKey HasPrivateKey HasPrivateKey HasPrivateKey

Gets a value indicating whether the certificate has a private key.

public : PlatForm::Boolean HasPrivateKey { get; }public bool HasPrivateKey { get; }Public ReadOnly Property HasPrivateKey As bool// You can use this property in JavaScript.
Value
PlatForm::Boolean bool bool bool

True if the certificate has a private key; otherwise false.

IsPerUser IsPerUser IsPerUser IsPerUser

Gets whether the certificate is per-user.

public : PlatForm::Boolean IsPerUser { get; }public bool IsPerUser { get; }Public ReadOnly Property IsPerUser As bool// You can use this property in JavaScript.
Value
PlatForm::Boolean bool bool bool

True if the certificate is per-user; otherwise, false.

Additional features and requirements
Device family
Windows 10 Anniversary Edition (introduced v10.0.14393.0)
API contract
Windows.Foundation.UniversalApiContract (introduced v3)

IsSecurityDeviceBound IsSecurityDeviceBound IsSecurityDeviceBound IsSecurityDeviceBound

Gets whether the security device is bound.

public : PlatForm::Boolean IsSecurityDeviceBound { get; }public bool IsSecurityDeviceBound { get; }Public ReadOnly Property IsSecurityDeviceBound As bool// You can use this property in JavaScript.
Value
PlatForm::Boolean bool bool bool

True if the security device is bound; otherwise, false.

IsStronglyProtected IsStronglyProtected IsStronglyProtected IsStronglyProtected

Gets a value that indicates whether the private key associated with the certificate is strongly protected.

public : PlatForm::Boolean IsStronglyProtected { get; }public bool IsStronglyProtected { get; }Public ReadOnly Property IsStronglyProtected As bool// You can use this property in JavaScript.
Value
PlatForm::Boolean bool bool bool

True if the certificate is strongly protected; otherwise false.

Issuer Issuer Issuer Issuer

Gets the name of the certificate issuer.

public : PlatForm::String Issuer { get; }public string Issuer { get; }Public ReadOnly Property Issuer As string// You can use this property in JavaScript.
Value
PlatForm::String string string string

The name of the certificate issuer.

KeyAlgorithmName KeyAlgorithmName KeyAlgorithmName KeyAlgorithmName

Gets the name of the cryptographic algorithm used to create the key.

public : PlatForm::String KeyAlgorithmName { get; }public string KeyAlgorithmName { get; }Public ReadOnly Property KeyAlgorithmName As string// You can use this property in JavaScript.
Value
PlatForm::String string string string

The name of the cryptographic algorithm used to create the key.

KeyStorageProviderName KeyStorageProviderName KeyStorageProviderName KeyStorageProviderName

Gets the certificate's key storage provider name.

public : PlatForm::String KeyStorageProviderName { get; }public string KeyStorageProviderName { get; }Public ReadOnly Property KeyStorageProviderName As string// You can use this property in JavaScript.
Value
PlatForm::String string string string

The certificate's key storage provider name.

Additional features and requirements
Device family
Windows 10 Anniversary Edition (introduced v10.0.14393.0)
API contract
Windows.Foundation.UniversalApiContract (introduced v3)

KeyUsages KeyUsages KeyUsages KeyUsages

Gets the key uses for the certificate.

public : CertificateKeyUsages KeyUsages { get; }public CertificateKeyUsages KeyUsages { get; }Public ReadOnly Property KeyUsages As CertificateKeyUsages// You can use this property in JavaScript.

SerialNumber SerialNumber SerialNumber SerialNumber

Gets the serial number of the certificate.

public : byte[] SerialNumber { get; }public byte[] SerialNumber { get; }Public ReadOnly Property SerialNumber As byte[]// You can use this property in JavaScript.
Value
byte[] byte[] byte[] byte[]

The serial number of the certificate.

SignatureAlgorithmName SignatureAlgorithmName SignatureAlgorithmName SignatureAlgorithmName

Gets the signature algorithm name.

public : PlatForm::String SignatureAlgorithmName { get; }public string SignatureAlgorithmName { get; }Public ReadOnly Property SignatureAlgorithmName As string// You can use this property in JavaScript.
Value
PlatForm::String string string string

The signature algorithm name.

SignatureHashAlgorithmName SignatureHashAlgorithmName SignatureHashAlgorithmName SignatureHashAlgorithmName

Gets the signature hash algorithm name.

public : PlatForm::String SignatureHashAlgorithmName { get; }public string SignatureHashAlgorithmName { get; }Public ReadOnly Property SignatureHashAlgorithmName As string// You can use this property in JavaScript.
Value
PlatForm::String string string string

The signature hash algorithm name.

StoreName StoreName StoreName StoreName

Gets the certificate's store name.

public : PlatForm::String StoreName { get; }public string StoreName { get; }Public ReadOnly Property StoreName As string// You can use this property in JavaScript.
Value
PlatForm::String string string string

The certificate's store name.

Additional features and requirements
Device family
Windows 10 Anniversary Edition (introduced v10.0.14393.0)
API contract
Windows.Foundation.UniversalApiContract (introduced v3)

Subject Subject Subject Subject

Gets the subject name of the certificate.

public : PlatForm::String Subject { get; }public string Subject { get; }Public ReadOnly Property Subject As string// You can use this property in JavaScript.
Value
PlatForm::String string string string

The subject name of the certificate.

SubjectAlternativeName SubjectAlternativeName SubjectAlternativeName SubjectAlternativeName

Gets info on 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.

ValidFrom ValidFrom ValidFrom ValidFrom

Gets the date and time after which the certificate is valid.

public : DateTime ValidFrom { get; }public DateTimeOffset ValidFrom { get; }Public ReadOnly Property ValidFrom As DateTimeOffset// You can use this property in JavaScript.
Value
DateTime DateTimeOffset DateTimeOffset DateTimeOffset

The date and time after which the certificate is valid.

ValidTo ValidTo ValidTo ValidTo

Gets the date and time after which the certificate is no longer valid.

public : DateTime ValidTo { get; }public DateTimeOffset ValidTo { get; }Public ReadOnly Property ValidTo As DateTimeOffset// You can use this property in JavaScript.
Value
DateTime DateTimeOffset DateTimeOffset DateTimeOffset

The date and time after which the certificate is no longer valid.

Methods

BuildChainAsync(IIterable) BuildChainAsync(IIterable) BuildChainAsync(IIterable) BuildChainAsync(IIterable)

Build a certificate chain for the specified certificates starting from the end entity certificate to the root.

public : IAsyncOperation<CertificateChain> BuildChainAsync(IIterable<Certificate> certificates)public IAsyncOperation<CertificateChain> BuildChainAsync(IEnumerable<Certificate> certificates)Public Function BuildChainAsync(certificates As IEnumerable<Certificate>) As IAsyncOperation( Of CertificateChain )// You can use this method in JavaScript.
Parameters
certificates
IIterable<Certificate> IEnumerable<Certificate> IEnumerable<Certificate> IEnumerable<Certificate>

The intermediate certificates to use when building the certificate chain.

Returns

An asynchronous operation to retrieve the CertificateChain object that contains the entire certificate chain.

See Also

BuildChainAsync(IIterable, ChainBuildingParameters) BuildChainAsync(IIterable, ChainBuildingParameters) BuildChainAsync(IIterable, ChainBuildingParameters) BuildChainAsync(IIterable, ChainBuildingParameters)

Build a certificate chain for the specified certificates starting from the end entity certificate to the root using the specified chain building parameters.

public : IAsyncOperation<CertificateChain> BuildChainAsync(IIterable<Certificate> certificates, ChainBuildingParameters parameters)public IAsyncOperation<CertificateChain> BuildChainAsync(IEnumerable<Certificate> certificates, ChainBuildingParameters parameters)Public Function BuildChainAsync(certificates As IEnumerable<Certificate>, parameters As ChainBuildingParameters) As IAsyncOperation( Of CertificateChain )// You can use this method in JavaScript.
Parameters
certificates
IIterable<Certificate> IEnumerable<Certificate> IEnumerable<Certificate> IEnumerable<Certificate>

The intermediate certificates to use when building the certificate chain.

parameters
ChainBuildingParameters ChainBuildingParameters ChainBuildingParameters ChainBuildingParameters

The chain building paramaters to use when building the certificate chain.

Returns

An asynchronous operation to retrieve the CertificateChain object that contains the entire certificate chain.

See Also

GetCertificateBlob() GetCertificateBlob() GetCertificateBlob() GetCertificateBlob()

Gets the ASN.1 DER encoded certificate blob.

public : IBuffer GetCertificateBlob()public IBuffer GetCertificateBlob()Public Function GetCertificateBlob() As IBuffer// You can use this method in JavaScript.
Returns

The ASN.1 DER encoded certificate blob.

GetHashValue() GetHashValue() GetHashValue() GetHashValue()

Gets the SHA1 hash value for the certificate.

public : byte[] GetHashValue()public byte[] GetHashValue()Public Function GetHashValue() As byte[]// You can use this method in JavaScript.
Returns
byte[] byte[] byte[] byte[]

The SHA1 hash value for the certificate.

See Also

GetHashValue(String) GetHashValue(String) GetHashValue(String) GetHashValue(String)

Gets the hash value for the certificate for a specified algorithm.

public : byte[] GetHashValue(PlatForm::String hashAlgorithmName)public byte[] GetHashValue(String hashAlgorithmName)Public Function GetHashValue(hashAlgorithmName As String) As byte[]// You can use this method in JavaScript.
Parameters
hashAlgorithmName
PlatForm::String String String String

The hash algorithm to use for the hash value of the certificate. Only values of "SHA1" or "SHA256" are supported. To get the SHA2 hash value for the certificate, specify "SHA256".

Returns
byte[] byte[] byte[] byte[]

The hash value of the certificate.

See Also