public class SecureConnectProvider implements MtlsProvider
This class implements MtlsProvider for the Google Auth library transport layer via ContextAwareMetadataJson. 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 throws com.google.auth.mtls.CertificateSourceUnavailableException instead 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.
Implements
MtlsProviderConstructors
SecureConnectProvider()
public SecureConnectProvider()
Methods
getKeyStore()
public KeyStore getKeyStore()
Returns a mutual TLS key store backed by the certificate provided by the SecureConnect tool.
Returns | |
---|---|
Type | Description |
KeyStore |
a KeyStore containing the certificate provided by the SecureConnect tool. |
Exceptions | |
---|---|
Type | Description |
CertificateSourceUnavailableException |
if the certificate source is unavailable (ex. missing configuration file). |
IOException |
if the certificate source is unavailable (ex. missing configuration file). |
isAvailable()
public boolean isAvailable()
Returns true if the SecureConnect mTLS provider is available.
Returns | |
---|---|
Type | Description |
boolean |
Exceptions | |
---|---|
Type | Description |
IOException |
if a general I/O error occurs while determining availability. |