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.
Modifier and Type | Class and Description |
---|---|
static class |
URLBasedX509CertificateSupplier.ResourceDetails |
X509CertificateSupplier.CertificateAndPrivateKeyPair
Modifier and Type | Field and 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 Connection
|
protected static String |
CERTIFICATE_URL_CONNECTION_TIMEOUT_IN_MILLIS |
Constructor and 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.
|
Modifier and Type | Method and 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.
|
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
protected static final String CERTIFICATE_URL_CONNECTION_TIMEOUT_IN_MILLIS
public URLBasedX509CertificateSupplier(URLBasedX509CertificateSupplier.ResourceDetails certificateResourceDetails, URLBasedX509CertificateSupplier.ResourceDetails privateKeyResourceDetails, char[] privateKeyPassphraseCharacters)
Constructor.
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 keyspublic URLBasedX509CertificateSupplier(URL certificateUrl, URL privateKeyUrl, char[] privateKeyPassphraseCharacters)
Constructor.
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@Deprecated public URLBasedX509CertificateSupplier(URL certificateUrl, URL privateKeyUrl, String privateKeyPassphrase)
URLBasedX509CertificateSupplier(URL,
URL, char[])
insteadConstructor.
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@Deprecated public X509Certificate getCertificate()
X509CertificateSupplier.getCertificateAndKeyPair()
insteadGets the certificate
getCertificate
in interface X509CertificateSupplier
public void refresh()
A method to refresh the X509 certificate.
refresh
in interface Refreshable
public boolean isCurrent()
So far we don’t care whether the certificate is current or not.
isCurrent
in interface Refreshable
@Deprecated public RSAPrivateKey getPrivateKey()
X509CertificateSupplier.getCertificateAndKeyPair()
insteadCorresponding 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.
getPrivateKey
in interface X509CertificateSupplier
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.
getCertificateAndKeyPair
in interface X509CertificateSupplier
Copyright © 2016–2024. All rights reserved.