Delen via


CredentialDescription.CertificateDistinguishedName Property

Definition

When SourceType is StoreWithDistinguishedName, specifies the distinguished name of the certificate in the store specified by CertificateStorePath.

public string? CertificateDistinguishedName { get; set; }
member this.CertificateDistinguishedName : string with get, set
Public Property CertificateDistinguishedName As String

Property Value

Examples

The JSON fragment below describes a user certificate stored in the personal certificates folder (CurrentUser/My) and specified by its distinguised name, used as a client credential in a confidential client application:

{
 "ClientCredentials": [
 {
  "SourceType": "StoreWithDistinguishedName",
  "CertificateStorePath": "CurrentUser/My",
  "CertificateDistinguishedName": "CN=WebAppCallingWebApiCert"
 }]
}

The code below describes programmatically in C#, a computer certificate in the personal certificates folder (LocalMachine/My).

CredentialDescription credentialDescription = new CredentialDescription
{
    SourceType = CredentialSource.StoreWithDistinguishedName,
    CertificateStorePath = "LocalMachine/My",
    CertificateDistinguishedName = "CN=WebAppCallingWebApiCert"

};

Applies to

See also