CredentialDescription.CertificatePassword Property

Definition

When SourceType is Path, specifies the password to use to access the certificate which path is specified by CertificateDiskPath. Only use this property if the certificate is protected by a password.

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

Property Value

Examples

The JSON fragment below describes a certificate retrieved by its path and a password to be used as a client credential in a confidential client application:

{
 "ClientCredentials": [
 {
  "SourceType": "Path",
  "CertificateDiskPath": "c:\\temp\\WebAppCallingWebApiCert.pfx",
  "CertificatePassword": "password"
 }]
}

The code below describes programmatically in C#, the same certificate.

CredentialDescription credentialDescription = new CredentialDescription
{
    SourceType = CredentialSource.Path,
    CertificateDiskPath = "c:\\temp\\WebAppCallingWebApiCert.pfx",
    CertificatePassword = "password"
};

Applies to

See also