CertificateQuery CertificateQuery CertificateQuery CertificateQuery Class

Definition

Represents parameters for a query for certificates from the certificate store for an app.

public : sealed class CertificateQuery : ICertificateQuery, ICertificateQuery2
public sealed class CertificateQuery : ICertificateQuery, ICertificateQuery2
Public NotInheritable Class CertificateQuery Implements ICertificateQuery, ICertificateQuery2
var certificateQuery = new certificateQuery();
Attributes
Windows 10 requirements
Device family
Windows 10 (introduced v10.0.10240.0)
API contract
Windows.Foundation.UniversalApiContract (introduced v1)

Constructors

CertificateQuery() CertificateQuery() CertificateQuery() CertificateQuery()

Creates a new instance of a certificate query.

public : CertificateQuery()
public CertificateQuery()
Public Sub New()
var certificateQuery = new certificateQuery();

Properties

EnhancedKeyUsages EnhancedKeyUsages EnhancedKeyUsages EnhancedKeyUsages

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

public : IVector<Platform::String> EnhancedKeyUsages { get; }
public IList<string> EnhancedKeyUsages { get; }
Public ReadOnly Property EnhancedKeyUsages As IList<string>
var iList = certificateQuery.enhancedKeyUsages;
Value
IVector<Platform::String> IList<string> IList<string> IList<string>

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

Examples

var query = new Windows.Security.Cryptography.Certificates.CertificateQuery();
query.issuerName = "Consoto Bank Issuing CA";
var enhancedKeyUsages = query.enhancedKeyUsages;
enhancedKeyUsage[0] = "1.3.6.1.5.5.7.3.2"; // client auth
var certificates;
Windows.Security.Cryptography.Certificates.
    CertificateStores.findAllAsync(query).done(function(queriedCertificates)
{
    certificates = queriedCertificates;
}, 
function(e) 
{
    WinJS.log("FindAllAsync failed, error:" + e.number + e.message);
});

FriendlyName FriendlyName FriendlyName FriendlyName

Gets or sets the certificate friendly name to search for.

public : Platform::String FriendlyName { get; set; }
public string FriendlyName { get; set; }
Public ReadWrite Property FriendlyName As string
var string = certificateQuery.friendlyName;
certificateQuery.friendlyName = string;
Value
Platform::String string string string

The certificate friendly name to search for.

HardwareOnly HardwareOnly HardwareOnly HardwareOnly

Gets or sets a value that indicates whether only hardware certificates (SC or TPM) are to be returned from the query.

public : Platform::Boolean HardwareOnly { get; set; }
public bool HardwareOnly { get; set; }
Public ReadWrite Property HardwareOnly As bool
var bool = certificateQuery.hardwareOnly;
certificateQuery.hardwareOnly = bool;
Value
Platform::Boolean bool bool bool

True if only hardware certificates (SC or TPM) are to be returned from the query; otherwise false.

IncludeDuplicates IncludeDuplicates IncludeDuplicates IncludeDuplicates

Gets or sets whether to include duplicates.

public : Platform::Boolean IncludeDuplicates { get; set; }
public bool IncludeDuplicates { get; set; }
Public ReadWrite Property IncludeDuplicates As bool
var bool = certificateQuery.includeDuplicates;
certificateQuery.includeDuplicates = bool;
Value
Platform::Boolean bool bool bool

True if duplicates are included; otherwise, false.

IncludeExpiredCertificates IncludeExpiredCertificates IncludeExpiredCertificates IncludeExpiredCertificates

Gets or sets whether to include expired certificates.

public : Platform::Boolean IncludeExpiredCertificates { get; set; }
public bool IncludeExpiredCertificates { get; set; }
Public ReadWrite Property IncludeExpiredCertificates As bool
var bool = certificateQuery.includeExpiredCertificates;
certificateQuery.includeExpiredCertificates = bool;
Value
Platform::Boolean bool bool bool

True if expired certificates should be included; otherwise, false.

IssuerName IssuerName IssuerName IssuerName

Gets or sets the name of the certificate issuer to search for.

public : Platform::String IssuerName { get; set; }
public string IssuerName { get; set; }
Public ReadWrite Property IssuerName As string
var string = certificateQuery.issuerName;
certificateQuery.issuerName = string;
Value
Platform::String string string string

The name of the certificate issuer to search for.

StoreName StoreName StoreName StoreName

Gets or sets the store name.

public : Platform::String StoreName { get; set; }
public string StoreName { get; set; }
Public ReadWrite Property StoreName As string
var string = certificateQuery.storeName;
certificateQuery.storeName = string;
Value
Platform::String string string string

The store name.

Thumbprint Thumbprint Thumbprint Thumbprint

Gets or sets a certificate thumbprint to search for.

public : byte[] Thumbprint { get; set; }
public byte[] Thumbprint { get; set; }
Public ReadWrite Property Thumbprint As byte[]
var byte[] = certificateQuery.thumbprint;
certificateQuery.thumbprint = byte[];
Value
byte[] byte[] byte[] byte[]

A certificate thumbprint to search for.