Share via


CredentialDescription.CertificateDiskPath Property

Definition

When SourceType is Path, specifies the path to the certificate on disk. You can use this property to specify the path to a PFX file containing the certificate and its private key. If a password is needed, use CertificatePassword.

public string? CertificateDiskPath { get; set; }
member this.CertificateDiskPath : string with get, set
Public Property CertificateDiskPath 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#, a the same certificate.

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

Applies to

See also