Class X509Provider (1.34.0)

public class X509Provider

This class provides certificate key stores to the Google Auth library transport layer via certificate configuration files. This is only meant to be used internally to Google Cloud libraries, and the public facing methods may be changed without notice, and have no guarantee of backwards compatability.

Inheritance

java.lang.Object > X509Provider

Constructors

X509Provider()

public X509Provider()

Creates a new X.509 provider that will check the environment variable path and the well known Gcloud certificate configuration location. This is meant for internal Google Cloud usage and behavior may be changed without warning.

X509Provider(String certConfigPathOverride)

public X509Provider(String certConfigPathOverride)

Creates an X509 provider with an override path for the certificate configuration, bypassing the normal checks for the well known certificate configuration file path and environment variable. This is meant for internal Google Cloud usage and behavior may be changed without warning.

Parameter
Name Description
certConfigPathOverride String

the path to read the certificate configuration from.

Methods

getKeyStore()

public KeyStore getKeyStore()

Finds the certificate configuration file, then builds a Keystore using the X.509 certificate and private key pointed to by the configuration. This will check the following locations in order.

  • The certificate config override path, if set.
  • The path pointed to by the "GOOGLE_API_CERTIFICATE_CONFIG" environment variable
  • The well known gcloud location for the certificate configuration file.
Returns
Type Description
KeyStore

a KeyStore containing the X.509 certificate specified by the certificate configuration.

Exceptions
Type Description
IOException

if there is an error retrieving the certificate configuration.