Data class representing context_aware_metadata.json file. This is meant for internal Google Cloud
usage and behavior may be changed without warning.
Note: This implementation is duplicated from the existing ContextAwareMetadataJson found in
the Gax library. The Gax library version of ContextAwareMetadataJson will be marked as deprecated
in the future.
An HttpTransportFactory that createsNetHttpTransportinstances configured for mTLS
(mutual TLS) using a specificKeyStorecontaining the client's certificate and private
key.
Warning:This class is considered internal and is not intended for direct use by
library consumers. Its API and behavior may change without notice.
This class implementsMtlsProviderfor the Google Auth library transport layer viaContextAwareMetadataJson. This is only meant to be used internally by Google Cloud libraries,
and the public facing methods may be changed without notice, and have no guarantee of backwards
compatibility.
Note: This implementation is derived from the existing "MtlsProvider" found in the Gax
library, with two notable differences: 1) All logic associated with parsing environment variables
related to "mTLS usage" are omitted - a separate helper class will be introduced in the Gax
library to serve this purpose. 2) getKeyStore throwscom.google.auth.mtls.CertificateSourceUnavailableExceptioninstead of returning "null" if this
cert source is not available on the device.
Additionally, this implementation will replace the existing "MtlsProvider" in the Gax library.
The Gax library version of MtlsProvider will be marked as deprecated.
This class implementsMtlsProviderfor the Google Auth library transport layer viaWorkloadCertificateConfiguration. This is only meant to be used internally by Google Cloud
libraries, and the public facing methods may be changed without notice, and have no guarantee of
backwards compatibility.
MtlsProvider is used by the Gax library for configuring mutual TLS in the HTTP and GRPC transport
layer. The source of the client certificate is up to the implementation.
This exception is thrown by certificate providers in the Google auth library when the certificate
source is unavailable. This means that the transport layer should move on to the next certificate
source provider type.
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Hard to understand","hardToUnderstand","thumb-down"],["Incorrect information or sample code","incorrectInformationOrSampleCode","thumb-down"],["Missing the information/samples I need","missingTheInformationSamplesINeed","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2025-09-04 UTC."],[],[],null,["# Package com.google.auth.mtls (1.38.0)\n\nVersion latestkeyboard_arrow_down\n\n- [1.38.0 (latest)](/java/docs/reference/google-auth-library/latest/com.google.auth.mtls)\n- [1.37.1](/java/docs/reference/google-auth-library/1.37.1/com.google.auth.mtls)\n- [1.36.0](/java/docs/reference/google-auth-library/1.36.0/com.google.auth.mtls)\n- [1.35.0](/java/docs/reference/google-auth-library/1.35.0/com.google.auth.mtls)\n- [1.34.0](/java/docs/reference/google-auth-library/1.34.0/com.google.auth.mtls)\n- [1.33.1](/java/docs/reference/google-auth-library/1.33.1/com.google.auth.mtls)\n- [1.32.1](/java/docs/reference/google-auth-library/1.32.1/com.google.auth.mtls)\n- [1.31.0](/java/docs/reference/google-auth-library/1.31.0/com.google.auth.mtls)\n- [1.30.1](/java/docs/reference/google-auth-library/1.30.1/com.google.auth.mtls)\n- [1.29.1-SNAPSHOT](/java/docs/reference/google-auth-library/1.29.1-SNAPSHOT/com.google.auth.mtls)\n- [1.28.0](/java/docs/reference/google-auth-library/1.28.0/com.google.auth.mtls)\n- [1.27.0](/java/docs/reference/google-auth-library/1.27.0/com.google.auth.mtls)\n- [1.26.0](/java/docs/reference/google-auth-library/1.26.0/com.google.auth.mtls)\n- [1.25.0](/java/docs/reference/google-auth-library/1.25.0/com.google.auth.mtls)\n- [1.24.1](/java/docs/reference/google-auth-library/1.24.1/com.google.auth.mtls)\n- [1.20.0](/java/docs/reference/google-auth-library/1.20.0/com.google.auth.mtls)\n- [1.19.0](/java/docs/reference/google-auth-library/1.19.0/com.google.auth.mtls)\n- [1.18.0](/java/docs/reference/google-auth-library/1.18.0/com.google.auth.mtls)\n- [1.7.0](/java/docs/reference/google-auth-library/1.7.0/com.google.auth.mtls)\n- [1.6.1](/java/docs/reference/google-auth-library/1.6.1/com.google.auth.mtls)\n- [1.4.0](/java/docs/reference/google-auth-library/1.4.0/com.google.auth.mtls)\n- [1.3.0](/java/docs/reference/google-auth-library/1.3.0/com.google.auth.mtls) \n\nClasses\n-------\n\n### [ContextAwareMetadataJson](/java/docs/reference/google-auth-library/latest/com.google.auth.mtls.ContextAwareMetadataJson)\n\nData class representing context_aware_metadata.json file. This is meant for internal Google Cloud\nusage and behavior may be changed without warning.\n\nNote: This implementation is duplicated from the existing ContextAwareMetadataJson found in\nthe Gax library. The Gax library version of ContextAwareMetadataJson will be marked as deprecated\nin the future.\n\n### [DefaultMtlsProviderFactory](/java/docs/reference/google-auth-library/latest/com.google.auth.mtls.DefaultMtlsProviderFactory)\n\n### [MtlsHttpTransportFactory](/java/docs/reference/google-auth-library/latest/com.google.auth.mtls.MtlsHttpTransportFactory)\n\nAn HttpTransportFactory that creates NetHttpTransport instances configured for mTLS\n(mutual TLS) using a specific [KeyStore](https://docs.oracle.com/javase/8/docs/api/java/security/KeyStore.html) containing the client's certificate and private\nkey.\n\n**Warning:** This class is considered internal and is not intended for direct use by\nlibrary consumers. Its API and behavior may change without notice.\n\n### [SecureConnectProvider](/java/docs/reference/google-auth-library/latest/com.google.auth.mtls.SecureConnectProvider)\n\nThis class implements [MtlsProvider](/java/docs/reference/google-auth-library/latest/com.google.auth.mtls.MtlsProvider) for the Google Auth library transport layer via [ContextAwareMetadataJson](/java/docs/reference/google-auth-library/latest/com.google.auth.mtls.ContextAwareMetadataJson). This is only meant to be used internally by Google Cloud libraries,\nand the public facing methods may be changed without notice, and have no guarantee of backwards\ncompatibility.\n\nNote: This implementation is derived from the existing \"MtlsProvider\" found in the Gax\nlibrary, with two notable differences: 1) All logic associated with parsing environment variables\nrelated to \"mTLS usage\" are omitted - a separate helper class will be introduced in the Gax\nlibrary to serve this purpose. 2) getKeyStore throws [com.google.auth.mtls.CertificateSourceUnavailableException](/java/docs/reference/google-auth-library/latest/com.google.auth.mtls.CertificateSourceUnavailableException) instead of returning \"null\" if this\ncert source is not available on the device.\n\nAdditionally, this implementation will replace the existing \"MtlsProvider\" in the Gax library.\nThe Gax library version of MtlsProvider will be marked as deprecated.\n\n### [X509Provider](/java/docs/reference/google-auth-library/latest/com.google.auth.mtls.X509Provider)\n\nThis class implements [MtlsProvider](/java/docs/reference/google-auth-library/latest/com.google.auth.mtls.MtlsProvider) for the Google Auth library transport layer via WorkloadCertificateConfiguration. This is only meant to be used internally by Google Cloud\nlibraries, and the public facing methods may be changed without notice, and have no guarantee of\nbackwards compatibility.\n\nInterfaces\n----------\n\n### [MtlsProvider](/java/docs/reference/google-auth-library/latest/com.google.auth.mtls.MtlsProvider)\n\nMtlsProvider is used by the Gax library for configuring mutual TLS in the HTTP and GRPC transport\nlayer. The source of the client certificate is up to the implementation.\n\nNote: This interface will replace the identically named \"MtlsProvider\" implementation in the\nGax library. The Gax library version of MtlsProvider will be marked as deprecated. See\n\u003chttps://github.com/googleapis/google-auth-library-java/issues/1758\u003e\n\nExceptions\n----------\n\n### [CertificateSourceUnavailableException](/java/docs/reference/google-auth-library/latest/com.google.auth.mtls.CertificateSourceUnavailableException)\n\nThis exception is thrown by certificate providers in the Google auth library when the certificate\nsource is unavailable. This means that the transport layer should move on to the next certificate\nsource provider type."]]