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
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)

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)
Parameters
certBlob
IBuffer IBuffer IBuffer

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

Attributes

Properties

EnhancedKeyUsages EnhancedKeyUsages EnhancedKeyUsages

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

public IVectorView<string> EnhancedKeyUsages { get; }public IVectorView<string> EnhancedKeyUsages { get; }Public ReadOnly Property EnhancedKeyUsages As IVectorView<string>
Value

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

Attributes

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
Value
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.

Attributes

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
Value
bool bool bool

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

Attributes

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
Value
bool bool bool

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

Attributes
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

Gets whether the security device is bound.

public PlatForm::Boolean IsSecurityDeviceBound { get; }public bool IsSecurityDeviceBound { get; }Public ReadOnly Property IsSecurityDeviceBound As bool
Value
bool bool bool

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

Attributes

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
Value
bool bool bool

True if the certificate is strongly protected; otherwise false.

Attributes

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
Value
string string string

The name of the certificate issuer.

Attributes

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
Value
string string string

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

Attributes

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
Value
string string string

The certificate's key storage provider name.

Attributes
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

Gets the key uses for the certificate.

public CertificateKeyUsages KeyUsages { get; }public CertificateKeyUsages KeyUsages { get; }Public ReadOnly Property KeyUsages As CertificateKeyUsages
Value
CertificateKeyUsages CertificateKeyUsages CertificateKeyUsages

The key uses for the certificate.

Attributes

SerialNumber SerialNumber SerialNumber

Gets the serial number of the certificate.

public byte[] SerialNumber { get; }public byte[] SerialNumber { get; }Public ReadOnly Property SerialNumber As byte[]
Value
byte[] byte[] byte[]

The serial number of the certificate.

Attributes

SignatureAlgorithmName SignatureAlgorithmName SignatureAlgorithmName

Gets the signature algorithm name.

public PlatForm::String SignatureAlgorithmName { get; }public string SignatureAlgorithmName { get; }Public ReadOnly Property SignatureAlgorithmName As string
Value
string string string

The signature algorithm name.

Attributes

SignatureHashAlgorithmName SignatureHashAlgorithmName SignatureHashAlgorithmName

Gets the signature hash algorithm name.

public PlatForm::String SignatureHashAlgorithmName { get; }public string SignatureHashAlgorithmName { get; }Public ReadOnly Property SignatureHashAlgorithmName As string
Value
string string string

The signature hash algorithm name.

Attributes

StoreName StoreName StoreName

Gets the certificate's store name.

public PlatForm::String StoreName { get; }public string StoreName { get; }Public ReadOnly Property StoreName As string
Value
string string string

The certificate's store name.

Attributes
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

Gets the subject name of the certificate.

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

The subject name of the certificate.

Attributes

SubjectAlternativeName SubjectAlternativeName SubjectAlternativeName

Gets info on the subject alternative name.

public SubjectAlternativeNameInfo SubjectAlternativeName { get; }public SubjectAlternativeNameInfo SubjectAlternativeName { get; }Public ReadOnly Property SubjectAlternativeName As SubjectAlternativeNameInfo
Attributes

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
Value
DateTime DateTime DateTime

The date and time after which the certificate is valid.

Attributes

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
Value
DateTime DateTime DateTime

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

Attributes

Methods

BuildChainAsync(IIterable<Certificate>) BuildChainAsync(IIterable<Certificate>) BuildChainAsync(IIterable<Certificate>)

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(IIterable<Certificate> certificates)Public Function BuildChainAsync(certificates As IIterable<Certificate>) As IAsyncOperation( Of CertificateChain )
Parameters
certificates

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.

Attributes

BuildChainAsync(IIterable<Certificate>, ChainBuildingParameters) BuildChainAsync(IIterable<Certificate>, ChainBuildingParameters) BuildChainAsync(IIterable<Certificate>, 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(IIterable<Certificate> certificates, ChainBuildingParameters parameters)Public Function BuildChainAsync(certificates As IIterable<Certificate>, parameters As ChainBuildingParameters) As IAsyncOperation( Of CertificateChain )
Parameters
certificates

The intermediate certificates to use when building the certificate chain.

parameters
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.

Attributes

GetCertificateBlob() GetCertificateBlob() GetCertificateBlob()

Gets the ASN.1 DER encoded certificate blob.

public IBuffer GetCertificateBlob()public IBuffer GetCertificateBlob()Public Function GetCertificateBlob() As IBuffer
Returns

The ASN.1 DER encoded certificate blob.

Attributes

GetHashValue() GetHashValue() GetHashValue()

Gets the SHA1 hash value for the certificate.

public byte[] GetHashValue()public byte[] GetHashValue()Public Function GetHashValue() As byte[]
Returns
byte[] byte[] byte[]

The SHA1 hash value for the certificate.

Attributes

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

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

public byte[] GetHashValue(String hashAlgorithmName)public byte[] GetHashValue(String hashAlgorithmName)Public Function GetHashValue(hashAlgorithmName As String) As byte[]
Parameters
hashAlgorithmName
System.String System.String System.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[]

The hash value of the certificate.

Attributes