azure-docs-sdk-java/docs-ref-autogen/com.azure.identity.ClientCe...

192 строки
26 KiB
YAML

### YamlMime:JavaType
uid: "com.azure.identity.ClientCertificateCredentialBuilder"
fullName: "com.azure.identity.ClientCertificateCredentialBuilder"
name: "ClientCertificateCredentialBuilder"
nameWithType: "ClientCertificateCredentialBuilder"
summary: "Fluent credential builder for instantiating a <xref uid=\"com.azure.identity.ClientCertificateCredential\" data-throw-if-not-resolved=\"false\" data-raw-source=\"ClientCertificateCredential\"></xref>."
inheritances:
- "<xref href=\"java.lang.Object?displayProperty=fullName\" data-throw-if-not-resolved=\"False\" />"
- "<xref href=\"com.azure.identity.CredentialBuilderBase?displayProperty=fullName\" data-throw-if-not-resolved=\"False\" />"
- "<xref href=\"com.azure.identity.AadCredentialBuilderBase?displayProperty=fullName\" data-throw-if-not-resolved=\"False\" />"
inheritedClassMethods:
- classRef: "<xref href=\"com.azure.identity.AadCredentialBuilderBase?alt=com.azure.identity.AadCredentialBuilderBase&text=AadCredentialBuilderBase\" data-throw-if-not-resolved=\"False\" />"
methodsRef:
- "<xref href=\"com.azure.identity.AadCredentialBuilderBase.additionallyAllowedTenants(java.lang.String...)?alt=com.azure.identity.AadCredentialBuilderBase.additionallyAllowedTenants&text=additionallyAllowedTenants\" data-throw-if-not-resolved=\"False\" />"
- "<xref href=\"com.azure.identity.AadCredentialBuilderBase.additionallyAllowedTenants(java.util.List<java.lang.String>)?alt=com.azure.identity.AadCredentialBuilderBase.additionallyAllowedTenants&text=additionallyAllowedTenants\" data-throw-if-not-resolved=\"False\" />"
- "<xref href=\"com.azure.identity.AadCredentialBuilderBase.authorityHost(java.lang.String)?alt=com.azure.identity.AadCredentialBuilderBase.authorityHost&text=authorityHost\" data-throw-if-not-resolved=\"False\" />"
- "<xref href=\"com.azure.identity.AadCredentialBuilderBase.clientId(java.lang.String)?alt=com.azure.identity.AadCredentialBuilderBase.clientId&text=clientId\" data-throw-if-not-resolved=\"False\" />"
- "<xref href=\"com.azure.identity.AadCredentialBuilderBase.disableInstanceDiscovery()?alt=com.azure.identity.AadCredentialBuilderBase.disableInstanceDiscovery&text=disableInstanceDiscovery\" data-throw-if-not-resolved=\"False\" />"
- "<xref href=\"com.azure.identity.AadCredentialBuilderBase.enableUnsafeSupportLogging()?alt=com.azure.identity.AadCredentialBuilderBase.enableUnsafeSupportLogging&text=enableUnsafeSupportLogging\" data-throw-if-not-resolved=\"False\" />"
- "<xref href=\"com.azure.identity.AadCredentialBuilderBase.executorService(java.util.concurrent.ExecutorService)?alt=com.azure.identity.AadCredentialBuilderBase.executorService&text=executorService\" data-throw-if-not-resolved=\"False\" />"
- "<xref href=\"com.azure.identity.AadCredentialBuilderBase.tenantId(java.lang.String)?alt=com.azure.identity.AadCredentialBuilderBase.tenantId&text=tenantId\" data-throw-if-not-resolved=\"False\" />"
- classRef: "<xref href=\"com.azure.identity.CredentialBuilderBase?alt=com.azure.identity.CredentialBuilderBase&text=CredentialBuilderBase\" data-throw-if-not-resolved=\"False\" />"
methodsRef:
- "<xref href=\"com.azure.identity.CredentialBuilderBase.addPolicy(com.azure.core.http.policy.HttpPipelinePolicy)?alt=com.azure.identity.CredentialBuilderBase.addPolicy&text=addPolicy\" data-throw-if-not-resolved=\"False\" />"
- "<xref href=\"com.azure.identity.CredentialBuilderBase.clientOptions(com.azure.core.util.ClientOptions)?alt=com.azure.identity.CredentialBuilderBase.clientOptions&text=clientOptions\" data-throw-if-not-resolved=\"False\" />"
- "<xref href=\"com.azure.identity.CredentialBuilderBase.configuration(com.azure.core.util.Configuration)?alt=com.azure.identity.CredentialBuilderBase.configuration&text=configuration\" data-throw-if-not-resolved=\"False\" />"
- "<xref href=\"com.azure.identity.CredentialBuilderBase.enableAccountIdentifierLogging()?alt=com.azure.identity.CredentialBuilderBase.enableAccountIdentifierLogging&text=enableAccountIdentifierLogging\" data-throw-if-not-resolved=\"False\" />"
- "<xref href=\"com.azure.identity.CredentialBuilderBase.httpClient(com.azure.core.http.HttpClient)?alt=com.azure.identity.CredentialBuilderBase.httpClient&text=httpClient\" data-throw-if-not-resolved=\"False\" />"
- "<xref href=\"com.azure.identity.CredentialBuilderBase.httpLogOptions(com.azure.core.http.policy.HttpLogOptions)?alt=com.azure.identity.CredentialBuilderBase.httpLogOptions&text=httpLogOptions\" data-throw-if-not-resolved=\"False\" />"
- "<xref href=\"com.azure.identity.CredentialBuilderBase.httpPipeline(com.azure.core.http.HttpPipeline)?alt=com.azure.identity.CredentialBuilderBase.httpPipeline&text=httpPipeline\" data-throw-if-not-resolved=\"False\" />"
- "<xref href=\"com.azure.identity.CredentialBuilderBase.maxRetry(int)?alt=com.azure.identity.CredentialBuilderBase.maxRetry&text=maxRetry\" data-throw-if-not-resolved=\"False\" />"
- "<xref href=\"com.azure.identity.CredentialBuilderBase.pipeline(com.azure.core.http.HttpPipeline)?alt=com.azure.identity.CredentialBuilderBase.pipeline&text=pipeline\" data-throw-if-not-resolved=\"False\" />"
- "<xref href=\"com.azure.identity.CredentialBuilderBase.proxyOptions(com.azure.core.http.ProxyOptions)?alt=com.azure.identity.CredentialBuilderBase.proxyOptions&text=proxyOptions\" data-throw-if-not-resolved=\"False\" />"
- "<xref href=\"com.azure.identity.CredentialBuilderBase.retryOptions(com.azure.core.http.policy.RetryOptions)?alt=com.azure.identity.CredentialBuilderBase.retryOptions&text=retryOptions\" data-throw-if-not-resolved=\"False\" />"
- "<xref href=\"com.azure.identity.CredentialBuilderBase.retryPolicy(com.azure.core.http.policy.RetryPolicy)?alt=com.azure.identity.CredentialBuilderBase.retryPolicy&text=retryPolicy\" data-throw-if-not-resolved=\"False\" />"
- "<xref href=\"com.azure.identity.CredentialBuilderBase.retryTimeout(java.util.function.Function<java.time.Duration,java.time.Duration>)?alt=com.azure.identity.CredentialBuilderBase.retryTimeout&text=retryTimeout\" data-throw-if-not-resolved=\"False\" />"
- classRef: "java.lang.<a href=\"https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html\">Object</a>"
methodsRef:
- "<a href=\"https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#clone--\">clone</a>"
- "<a href=\"https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#equals-java.lang.Object-\">equals</a>"
- "<a href=\"https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#finalize--\">finalize</a>"
- "<a href=\"https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#getClass--\">getClass</a>"
- "<a href=\"https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#hashCode--\">hashCode</a>"
- "<a href=\"https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#notify--\">notify</a>"
- "<a href=\"https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#notifyAll--\">notifyAll</a>"
- "<a href=\"https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#toString--\">toString</a>"
- "<a href=\"https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#wait--\">wait</a>"
- "<a href=\"https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#wait-long-\">wait</a>"
- "<a href=\"https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#wait-long-int-\">wait</a>"
syntax: "public class **ClientCertificateCredentialBuilder**</br> extends <xref href=\"com.azure.identity.AadCredentialBuilderBase?alt=com.azure.identity.AadCredentialBuilderBase&text=AadCredentialBuilderBase\" data-throw-if-not-resolved=\"False\" />&lt;<xref href=\"com.azure.identity.ClientCertificateCredentialBuilder?alt=com.azure.identity.ClientCertificateCredentialBuilder&text=ClientCertificateCredentialBuilder\" data-throw-if-not-resolved=\"False\" />&gt;"
constructors:
- uid: "com.azure.identity.ClientCertificateCredentialBuilder.ClientCertificateCredentialBuilder()"
fullName: "com.azure.identity.ClientCertificateCredentialBuilder.ClientCertificateCredentialBuilder()"
name: "ClientCertificateCredentialBuilder()"
nameWithType: "ClientCertificateCredentialBuilder.ClientCertificateCredentialBuilder()"
summary: "Constructs an instance of Client<wbr>Certificate<wbr>Credential<wbr>Builder."
syntax: "public ClientCertificateCredentialBuilder()"
desc: "Constructs an instance of ClientCertificateCredentialBuilder."
methods:
- uid: "com.azure.identity.ClientCertificateCredentialBuilder.build()"
fullName: "com.azure.identity.ClientCertificateCredentialBuilder.build()"
name: "build()"
nameWithType: "ClientCertificateCredentialBuilder.build()"
summary: "Creates a new <xref uid=\"com.azure.identity.ClientCertificateCredential\" data-throw-if-not-resolved=\"false\" data-raw-source=\"ClientCertificateCredential\"></xref> with the current configurations."
syntax: "public ClientCertificateCredential build()"
desc: "Creates a new <xref uid=\"com.azure.identity.ClientCertificateCredential\" data-throw-if-not-resolved=\"false\" data-raw-source=\"ClientCertificateCredential\"></xref> with the current configurations."
returns:
description: "a <xref uid=\"com.azure.identity.ClientCertificateCredential\" data-throw-if-not-resolved=\"false\" data-raw-source=\"ClientCertificateCredential\"></xref> with the current configurations."
type: "<xref href=\"com.azure.identity.ClientCertificateCredential?alt=com.azure.identity.ClientCertificateCredential&text=ClientCertificateCredential\" data-throw-if-not-resolved=\"False\" />"
- uid: "com.azure.identity.ClientCertificateCredentialBuilder.clientCertificatePassword(java.lang.String)"
fullName: "com.azure.identity.ClientCertificateCredentialBuilder.clientCertificatePassword(String clientCertificatePassword)"
name: "clientCertificatePassword(String clientCertificatePassword)"
nameWithType: "ClientCertificateCredentialBuilder.clientCertificatePassword(String clientCertificatePassword)"
summary: "Sets the password of the client certificate for authenticating to Microsoft Entra ID."
parameters:
- description: "the password protecting the certificate"
name: "clientCertificatePassword"
type: "<a href=\"https://docs.oracle.com/javase/8/docs/api/java/lang/String.html\">String</a>"
syntax: "public ClientCertificateCredentialBuilder clientCertificatePassword(String clientCertificatePassword)"
desc: "Sets the password of the client certificate for authenticating to Microsoft Entra ID."
returns:
description: "An updated instance of this builder."
type: "<xref href=\"com.azure.identity.ClientCertificateCredentialBuilder?alt=com.azure.identity.ClientCertificateCredentialBuilder&text=ClientCertificateCredentialBuilder\" data-throw-if-not-resolved=\"False\" />"
- uid: "com.azure.identity.ClientCertificateCredentialBuilder.pemCertificate(java.io.InputStream)"
fullName: "com.azure.identity.ClientCertificateCredentialBuilder.pemCertificate(InputStream certificate)"
name: "pemCertificate(InputStream certificate)"
nameWithType: "ClientCertificateCredentialBuilder.pemCertificate(InputStream certificate)"
summary: "Sets the input stream holding the PEM certificate for authenticating to Microsoft Entra ID."
parameters:
- description: "the input stream containing the PEM certificate"
name: "certificate"
type: "<a href=\"https://docs.oracle.com/javase/8/docs/api/java/io/InputStream.html\">InputStream</a>"
syntax: "public ClientCertificateCredentialBuilder pemCertificate(InputStream certificate)"
desc: "Sets the input stream holding the PEM certificate for authenticating to Microsoft Entra ID."
returns:
description: "An updated instance of this builder."
type: "<xref href=\"com.azure.identity.ClientCertificateCredentialBuilder?alt=com.azure.identity.ClientCertificateCredentialBuilder&text=ClientCertificateCredentialBuilder\" data-throw-if-not-resolved=\"False\" />"
- uid: "com.azure.identity.ClientCertificateCredentialBuilder.pemCertificate(java.lang.String)"
fullName: "com.azure.identity.ClientCertificateCredentialBuilder.pemCertificate(String certificatePath)"
name: "pemCertificate(String certificatePath)"
nameWithType: "ClientCertificateCredentialBuilder.pemCertificate(String certificatePath)"
summary: "Sets the path of the PEM certificate for authenticating to Microsoft Entra ID."
parameters:
- description: "the PEM file containing the certificate"
name: "certificatePath"
type: "<a href=\"https://docs.oracle.com/javase/8/docs/api/java/lang/String.html\">String</a>"
syntax: "public ClientCertificateCredentialBuilder pemCertificate(String certificatePath)"
desc: "Sets the path of the PEM certificate for authenticating to Microsoft Entra ID."
returns:
description: "An updated instance of this builder."
type: "<xref href=\"com.azure.identity.ClientCertificateCredentialBuilder?alt=com.azure.identity.ClientCertificateCredentialBuilder&text=ClientCertificateCredentialBuilder\" data-throw-if-not-resolved=\"False\" />"
- uid: "com.azure.identity.ClientCertificateCredentialBuilder.pfxCertificate(java.io.InputStream)"
fullName: "com.azure.identity.ClientCertificateCredentialBuilder.pfxCertificate(InputStream certificate)"
name: "pfxCertificate(InputStream certificate)"
nameWithType: "ClientCertificateCredentialBuilder.pfxCertificate(InputStream certificate)"
summary: "Sets the input stream holding the PFX certificate for authenticating to Microsoft Entra ID."
parameters:
- description: "the input stream containing the password protected PFX certificate"
name: "certificate"
type: "<a href=\"https://docs.oracle.com/javase/8/docs/api/java/io/InputStream.html\">InputStream</a>"
syntax: "public ClientCertificateCredentialBuilder pfxCertificate(InputStream certificate)"
desc: "Sets the input stream holding the PFX certificate for authenticating to Microsoft Entra ID."
returns:
description: "An updated instance of this builder."
type: "<xref href=\"com.azure.identity.ClientCertificateCredentialBuilder?alt=com.azure.identity.ClientCertificateCredentialBuilder&text=ClientCertificateCredentialBuilder\" data-throw-if-not-resolved=\"False\" />"
- uid: "com.azure.identity.ClientCertificateCredentialBuilder.pfxCertificate(java.lang.String)"
fullName: "com.azure.identity.ClientCertificateCredentialBuilder.pfxCertificate(String certificatePath)"
name: "pfxCertificate(String certificatePath)"
nameWithType: "ClientCertificateCredentialBuilder.pfxCertificate(String certificatePath)"
summary: "Sets the path of the PFX certificate for authenticating to Microsoft Entra ID."
parameters:
- description: "the password protected PFX file containing the certificate"
name: "certificatePath"
type: "<a href=\"https://docs.oracle.com/javase/8/docs/api/java/lang/String.html\">String</a>"
syntax: "public ClientCertificateCredentialBuilder pfxCertificate(String certificatePath)"
desc: "Sets the path of the PFX certificate for authenticating to Microsoft Entra ID."
returns:
description: "An updated instance of this builder."
type: "<xref href=\"com.azure.identity.ClientCertificateCredentialBuilder?alt=com.azure.identity.ClientCertificateCredentialBuilder&text=ClientCertificateCredentialBuilder\" data-throw-if-not-resolved=\"False\" />"
- uid: "com.azure.identity.ClientCertificateCredentialBuilder.pfxCertificate(java.lang.String,java.lang.String)"
fullName: "com.azure.identity.ClientCertificateCredentialBuilder.pfxCertificate(String certificatePath, String clientCertificatePassword)"
name: "pfxCertificate(String certificatePath, String clientCertificatePassword)"
nameWithType: "ClientCertificateCredentialBuilder.pfxCertificate(String certificatePath, String clientCertificatePassword)"
summary: "Sets the path and password of the PFX certificate for authenticating to Microsoft Entra ID."
deprecatedTag: "This API is deprecated and will be removed. Specify the PFX certificate via <xref uid=\"com.azure.identity.ClientCertificateCredentialBuilder.pfxCertificate(java.lang.String)\" data-throw-if-not-resolved=\"false\" data-raw-source=\"ClientCertificateCredentialBuilder#pfxCertificate(String)\"></xref> API and client certificate password via the <xref uid=\"com.azure.identity.ClientCertificateCredentialBuilder.clientCertificatePassword(java.lang.String)\" data-throw-if-not-resolved=\"false\" data-raw-source=\"ClientCertificateCredentialBuilder#clientCertificatePassword(String)\"></xref> API as applicable."
parameters:
- description: "the password protected PFX file containing the certificate"
name: "certificatePath"
type: "<a href=\"https://docs.oracle.com/javase/8/docs/api/java/lang/String.html\">String</a>"
- description: "the password protecting the PFX file"
name: "clientCertificatePassword"
type: "<a href=\"https://docs.oracle.com/javase/8/docs/api/java/lang/String.html\">String</a>"
syntax: "<a href=\"https://docs.oracle.com/javase/8/docs/api/java/lang/Deprecated.html\">@Deprecated</a></br>public ClientCertificateCredentialBuilder pfxCertificate(String certificatePath, String clientCertificatePassword)"
desc: "Sets the path and password of the PFX certificate for authenticating to Microsoft Entra ID."
hasDeprecatedTag: true
returns:
description: "An updated instance of this builder."
type: "<xref href=\"com.azure.identity.ClientCertificateCredentialBuilder?alt=com.azure.identity.ClientCertificateCredentialBuilder&text=ClientCertificateCredentialBuilder\" data-throw-if-not-resolved=\"False\" />"
- uid: "com.azure.identity.ClientCertificateCredentialBuilder.sendCertificateChain(boolean)"
fullName: "com.azure.identity.ClientCertificateCredentialBuilder.sendCertificateChain(boolean sendCertificateChain)"
name: "sendCertificateChain(boolean sendCertificateChain)"
nameWithType: "ClientCertificateCredentialBuilder.sendCertificateChain(boolean sendCertificateChain)"
summary: "Specifies if the x5c claim (public key of the certificate) should be sent as part of the authentication request and enable subject name / issuer based authentication."
parameters:
- description: "the flag to indicate if certificate chain should be sent as part of authentication\n request."
name: "sendCertificateChain"
type: "<xref href=\"boolean?alt=boolean&text=boolean\" data-throw-if-not-resolved=\"False\" />"
syntax: "public ClientCertificateCredentialBuilder sendCertificateChain(boolean sendCertificateChain)"
desc: "Specifies if the x5c claim (public key of the certificate) should be sent as part of the authentication request and enable subject name / issuer based authentication. The default value is false."
returns:
description: "An updated instance of this builder."
type: "<xref href=\"com.azure.identity.ClientCertificateCredentialBuilder?alt=com.azure.identity.ClientCertificateCredentialBuilder&text=ClientCertificateCredentialBuilder\" data-throw-if-not-resolved=\"False\" />"
- uid: "com.azure.identity.ClientCertificateCredentialBuilder.tokenCachePersistenceOptions(com.azure.identity.TokenCachePersistenceOptions)"
fullName: "com.azure.identity.ClientCertificateCredentialBuilder.tokenCachePersistenceOptions(TokenCachePersistenceOptions tokenCachePersistenceOptions)"
name: "tokenCachePersistenceOptions(TokenCachePersistenceOptions tokenCachePersistenceOptions)"
nameWithType: "ClientCertificateCredentialBuilder.tokenCachePersistenceOptions(TokenCachePersistenceOptions tokenCachePersistenceOptions)"
summary: "Configures the persistent shared token cache options and enables the persistent token cache which is disabled by default."
parameters:
- description: "the token cache configuration options"
name: "tokenCachePersistenceOptions"
type: "<xref href=\"com.azure.identity.TokenCachePersistenceOptions?alt=com.azure.identity.TokenCachePersistenceOptions&text=TokenCachePersistenceOptions\" data-throw-if-not-resolved=\"False\" />"
syntax: "public ClientCertificateCredentialBuilder tokenCachePersistenceOptions(TokenCachePersistenceOptions tokenCachePersistenceOptions)"
desc: "Configures the persistent shared token cache options and enables the persistent token cache which is disabled by default. If configured, the credential will store tokens in a cache persisted to the machine, protected to the current user, which can be shared by other credentials and processes."
returns:
description: "An updated instance of this builder with the token cache options configured."
type: "<xref href=\"com.azure.identity.ClientCertificateCredentialBuilder?alt=com.azure.identity.ClientCertificateCredentialBuilder&text=ClientCertificateCredentialBuilder\" data-throw-if-not-resolved=\"False\" />"
type: "class"
desc: "Fluent credential builder for instantiating a <xref uid=\"com.azure.identity.ClientCertificateCredential\" data-throw-if-not-resolved=\"false\" data-raw-source=\"ClientCertificateCredential\"></xref>.\n\nThe ClientCertificateCredential acquires a token via service principal authentication. It is a type of authentication in Azure that enables a non-interactive login to [Microsoft Entra ID][], allowing an application or service to authenticate itself with Azure resources. A Service Principal is essentially an identity created for an application in Microsoft Entra ID that can be used to authenticate with Azure resources. It's like a \"user identity\" for the application or service, and it provides a way for the application to authenticate itself with Azure resources without needing to use a user's credentials. [Microsoft Entra ID][] allows users to register service principals which can be used as an identity for authentication. A client certificate associated with the registered service principal is used as the password when authenticating the service principal. The <xref uid=\"com.azure.identity.ClientCertificateCredentialBuilder\" data-throw-if-not-resolved=\"false\" data-raw-source=\"ClientCertificateCredentialBuilder\"></xref> acquires an access token with a client certificate for a service principal/registered Microsoft Entra application. The tenantId, clientId and clientCertificate of the service principal are required for this credential to acquire an access token. It can be used both in Azure hosted and local development environments for authentication. For more information refer to the [conceptual knowledge and configuration details][].\n\n**Sample: Construct a simple ClientCertificateCredential**\n\nThe following code sample demonstrates the creation of a <xref uid=\"com.azure.identity.ClientCertificateCredential\" data-throw-if-not-resolved=\"false\" data-raw-source=\"com.azure.identity.ClientCertificateCredential\"></xref>, using the <xref uid=\"com.azure.identity.ClientCertificateCredentialBuilder\" data-throw-if-not-resolved=\"false\" data-raw-source=\"com.azure.identity.ClientCertificateCredentialBuilder\"></xref> to configure it. The `tenantId`, `clientId` and `certificate` parameters are required to create <xref uid=\"com.azure.identity.ClientCertificateCredential\" data-throw-if-not-resolved=\"false\" data-raw-source=\"com.azure.identity.ClientCertificateCredential\"></xref>. Once this credential is created, it may be passed into the builder of many of the Azure SDK for Java client builders as the 'credential' parameter.\n\n```java\nTokenCredential clientCertificateCredential = new ClientCertificateCredentialBuilder().tenantId(tenantId)\n .clientId(clientId)\n .pemCertificate(\"<PATH-TO-PEM-CERTIFICATE>\")\n .build();\n```\n\n**Sample: Construct a ClientCertificateCredential using <xref uid=\"\" data-throw-if-not-resolved=\"false\" data-raw-source=\"ByteArrayInputStream\"></xref>**\n\nThe following code sample demonstrates the creation of a <xref uid=\"com.azure.identity.ClientCertificateCredential\" data-throw-if-not-resolved=\"false\" data-raw-source=\"com.azure.identity.ClientCertificateCredential\"></xref>, using the <xref uid=\"com.azure.identity.ClientCertificateCredentialBuilder\" data-throw-if-not-resolved=\"false\" data-raw-source=\"com.azure.identity.ClientCertificateCredentialBuilder\"></xref> to configure it. The `tenantId`, `clientId` and `certificate` parameters are required to create <xref uid=\"com.azure.identity.ClientSecretCredential\" data-throw-if-not-resolved=\"false\" data-raw-source=\"com.azure.identity.ClientSecretCredential\"></xref>. The `certificate` in this example is configured as a <xref uid=\"\" data-throw-if-not-resolved=\"false\" data-raw-source=\"ByteArrayInputStream\"></xref>. This is helpful if the certificate is available in memory via a cert store.\n\n```java\nByteArrayInputStream certificateStream = new ByteArrayInputStream(certificateBytes);\n TokenCredential certificateCredentialWithStream = new ClientCertificateCredentialBuilder().tenantId(tenantId)\n .clientId(clientId)\n .pemCertificate(certificateStream)\n .build();\n```\n\n**Sample: Construct a ClientCertificateCredential behind a proxy**\n\nThe following code sample demonstrates the creation of a <xref uid=\"com.azure.identity.ClientCertificateCredential\" data-throw-if-not-resolved=\"false\" data-raw-source=\"com.azure.identity.ClientCertificateCredential\"></xref>, using the <xref uid=\"com.azure.identity.ClientCertificateCredentialBuilder\" data-throw-if-not-resolved=\"false\" data-raw-source=\"com.azure.identity.ClientCertificateCredentialBuilder\"></xref> to configure it. The `tenantId`, `clientId` and `certificate` parameters are required to create <xref uid=\"com.azure.identity.ClientSecretCredential\" data-throw-if-not-resolved=\"false\" data-raw-source=\"com.azure.identity.ClientSecretCredential\"></xref>. The `proxyOptions` can be optionally configured to target a proxy. Once this credential is created, it may be passed into the builder of many of the Azure SDK for Java client builders as the 'credential' parameter.\n\n```java\nTokenCredential certificateCredential = new ClientCertificateCredentialBuilder().tenantId(tenantId)\n .clientId(clientId)\n .pfxCertificate(\"<PATH-TO-PFX-CERTIFICATE>\", \"P@s$w0rd\")\n .proxyOptions(new ProxyOptions(Type.HTTP, new InetSocketAddress(\"10.21.32.43\", 5465)))\n .build();\n```\n\n\n[Microsoft Entra ID]: https://learn.microsoft.com/entra/fundamentals/\n[conceptual knowledge and configuration details]: https://aka.ms/azsdk/java/identity/clientcertificatecredential/docs"
metadata: {}
package: "com.azure.identity"
artifact: com.azure:azure-identity:1.14.1