Package com.oracle.bmc.auth
Class URLBasedX509CertificateSupplier
- java.lang.Object
-
- com.oracle.bmc.auth.URLBasedX509CertificateSupplier
-
- All Implemented Interfaces:
X509CertificateSupplier
,Refreshable
public class URLBasedX509CertificateSupplier extends Object implements X509CertificateSupplier, Refreshable
X509CertificateSupplier
implementation that reads both certificate and private key off of URL.This class also provides a way to manually refresh the certificate and private key at any point.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
URLBasedX509CertificateSupplier.ResourceDetails
-
Nested classes/interfaces inherited from interface com.oracle.bmc.auth.X509CertificateSupplier
X509CertificateSupplier.CertificateAndPrivateKeyPair
-
-
Field Summary
Fields Modifier and Type Field Description protected static String
CERTIFICATE_URL_CONNECTION_READ_TIMEOUT_IN_MILLIS
Set the environment variables to configure read timeout and connection timeout (in milliseconds) for URL Connectionprotected static String
CERTIFICATE_URL_CONNECTION_TIMEOUT_IN_MILLIS
-
Constructor Summary
Constructors Constructor Description URLBasedX509CertificateSupplier(URLBasedX509CertificateSupplier.ResourceDetails certificateResourceDetails, URLBasedX509CertificateSupplier.ResourceDetails privateKeyResourceDetails, char[] privateKeyPassphraseCharacters)
Constructor.URLBasedX509CertificateSupplier(URL certificateUrl, URL privateKeyUrl, char[] privateKeyPassphraseCharacters)
Constructor.URLBasedX509CertificateSupplier(URL certificateUrl, URL privateKeyUrl, String privateKeyPassphrase)
Deprecated.
-
Method Summary
All Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description X509Certificate
getCertificate()
Deprecated.X509CertificateSupplier.CertificateAndPrivateKeyPair
getCertificateAndKeyPair()
Returns the X509 certificate and private key.RSAPrivateKey
getPrivateKey()
Deprecated.boolean
isCurrent()
So far we don’t care whether the certificate is current or not.void
refresh()
A method to refresh the X509 certificate.
-
-
-
Field Detail
-
CERTIFICATE_URL_CONNECTION_READ_TIMEOUT_IN_MILLIS
protected static final String CERTIFICATE_URL_CONNECTION_READ_TIMEOUT_IN_MILLIS
Set the environment variables to configure read timeout and connection timeout (in milliseconds) for URL Connection
-
CERTIFICATE_URL_CONNECTION_TIMEOUT_IN_MILLIS
protected static final String CERTIFICATE_URL_CONNECTION_TIMEOUT_IN_MILLIS
-
-
Constructor Detail
-
URLBasedX509CertificateSupplier
public URLBasedX509CertificateSupplier(URLBasedX509CertificateSupplier.ResourceDetails certificateResourceDetails, URLBasedX509CertificateSupplier.ResourceDetails privateKeyResourceDetails, char[] privateKeyPassphraseCharacters)
Constructor.- Parameters:
certificateResourceDetails
- The certificate resource detailsprivateKeyResourceDetails
- The private key resource details, may be null for intermediate certificatesprivateKeyPassphraseCharacters
- The private key passphrase, may be null for unencrypted private keys
-
URLBasedX509CertificateSupplier
public URLBasedX509CertificateSupplier(URL certificateUrl, URL privateKeyUrl, char[] privateKeyPassphraseCharacters)
Constructor.- Parameters:
certificateUrl
- The certificate urlprivateKeyUrl
- The private key url, may be null for intermediate certificatesprivateKeyPassphraseCharacters
- The private key passphrase, may be null for unencrypted private keys
-
URLBasedX509CertificateSupplier
@Deprecated public URLBasedX509CertificateSupplier(URL certificateUrl, URL privateKeyUrl, String privateKeyPassphrase)
Deprecated.Constructor.- Parameters:
certificateUrl
- The certificate urlprivateKeyUrl
- The private key url, may be null for intermediate certificatesprivateKeyPassphrase
- The private key passphrase, may be null for unencrypted private keys
-
-
Method Detail
-
getCertificate
@Deprecated public X509Certificate getCertificate()
Deprecated.Gets the certificate- Specified by:
getCertificate
in interfaceX509CertificateSupplier
- Returns:
- The certificate, must not be null
-
refresh
public void refresh()
A method to refresh the X509 certificate.- Specified by:
refresh
in interfaceRefreshable
-
isCurrent
public boolean isCurrent()
So far we don’t care whether the certificate is current or not.- Specified by:
isCurrent
in interfaceRefreshable
- Returns:
- false always.
-
getPrivateKey
@Deprecated public RSAPrivateKey getPrivateKey()
Deprecated.Corresponding private key of the certificate.You must implement this method for leaf certificates (to sign the request made to the auth service to get a security token). For intermediate certificates, you can return null.
- Specified by:
getPrivateKey
in interfaceX509CertificateSupplier
- Returns:
- The private key
-
getCertificateAndKeyPair
public X509CertificateSupplier.CertificateAndPrivateKeyPair getCertificateAndKeyPair()
Returns the X509 certificate and private key.The X509 certificate will always be valid. The private key may be null for intermediate certificates. For leaf certificates, the private key will always be valid.
- Specified by:
getCertificateAndKeyPair
in interfaceX509CertificateSupplier
- Returns:
- The certificate and private key pair.
-
-