Azure OSS for PHP API Reference

ClientCertificateCredential
in package
implements TokenCredential

FinalYes

Authenticates a Microsoft Entra service principal with a client certificate.

Table of Contents

Interfaces

TokenCredential
Defines how an Azure credential obtains access tokens.

Properties

$clientCertificatePassword  : string|null
$clientCertificatePath  : string
$clientId  : string
$options  : ClientCertificateCredentialOptions
$tenantId  : string

Methods

__construct()  : mixed
getToken()  : AccessToken
Requests an access token for the supplied OAuth scopes.
assertRsaKey()  : void
base64UrlEncode()  : string
createClientAssertion()  : string
loadCertificateMaterial()  : OpenSSLAsymmetricKey, leafCertificateDer: string, certificateChainDer: list}
loadPemCertificateMaterial()  : OpenSSLAsymmetricKey, leafCertificateDer: string, certificateChainDer: list}
loadPkcs12CertificateMaterial()  : OpenSSLAsymmetricKey, leafCertificateDer: string, certificateChainDer: list}
parseCertificateDerFromPem()  : array<int, string>
Parse PEM content and return DER-encoded bytes for each certificate found.

Properties

Methods

__construct()

public __construct(string $tenantId, string $clientId, string $clientCertificatePath[, string|null $clientCertificatePassword = null ][, ClientCertificateCredentialOptions $options = new ClientCertificateCredentialOptions() ]) : mixed
Parameters
$tenantId : string

Microsoft Entra tenant ID.

$clientId : string

Application (client) ID.

$clientCertificatePath : string

Path to PEM or PKCS#12 certificate material.

$clientCertificatePassword : string|null = null

Password for encrypted certificate material.

$options : ClientCertificateCredentialOptions = new ClientCertificateCredentialOptions()

loadCertificateMaterial()

private loadCertificateMaterial() : OpenSSLAsymmetricKey, leafCertificateDer: string, certificateChainDer: list}
Return values
OpenSSLAsymmetricKey, leafCertificateDer: string, certificateChainDer: list}

loadPemCertificateMaterial()

private loadPemCertificateMaterial(string $pemContents) : OpenSSLAsymmetricKey, leafCertificateDer: string, certificateChainDer: list}
Parameters
$pemContents : string
Return values
OpenSSLAsymmetricKey, leafCertificateDer: string, certificateChainDer: list}

loadPkcs12CertificateMaterial()

private loadPkcs12CertificateMaterial(string $pkcs12Contents) : OpenSSLAsymmetricKey, leafCertificateDer: string, certificateChainDer: list}
Parameters
$pkcs12Contents : string
Return values
OpenSSLAsymmetricKey, leafCertificateDer: string, certificateChainDer: list}

parseCertificateDerFromPem()

Parse PEM content and return DER-encoded bytes for each certificate found.

private parseCertificateDerFromPem(string $pemContents) : array<int, string>
Parameters
$pemContents : string
Return values
array<int, string>
On this page

Search results