Interface OciCertificatesDownloader
The contract used for downloading certificates from OCI.
-
Nested Class Summary
Nested ClassesModifier and TypeInterfaceDescriptionstatic classRepresents the certificate chain as well as the version identifier of the downloaded certificates.static final classRepresents a leaf-first certificate chain, its matching private key, and its version identifier. -
Method Summary
Modifier and TypeMethodDescriptioncreate(String version, X509Certificate[] certificates) Creates a Certificates instance given its version and array of certificates.create(String version, X509Certificate[] certificates, PrivateKey privateKey) Creates a certificate bundle with its matching private key.loadCACertificate(String caCertOcid) The implementation will download the CA certificate identified by the given ocid from the OCI Certificates Services.loadCertificates(String certOcid) The implementation will download the certificate chain identified by the given ocid from the OCI Certificates Service.loadCertificatesWithPrivateKey(String certOcid) Downloads the certificate chain and its matching private key from the OCI Certificates Service.
-
Method Details
-
loadCertificates
The implementation will download the certificate chain identified by the given ocid from the OCI Certificates Service.- Parameters:
certOcid- the cert ocid- Returns:
- the downloaded certificate chain
- Throws:
IllegalStateException- if there is any errors loading the key- See Also:
-
loadCertificatesWithPrivateKey
default OciCertificatesDownloader.CertificatesWithPrivateKey loadCertificatesWithPrivateKey(String certOcid) Downloads the certificate chain and its matching private key from the OCI Certificates Service. Implementations predating support for OCI-managed private-key bundles do not need to implement this method.- Parameters:
certOcid- the certificate OCID- Returns:
- the downloaded certificate chain and private key
- Throws:
UnsupportedOperationException- if this implementation cannot download a private-key bundleIllegalStateException- if there are any errors loading the certificate or key- See Also:
-
loadCACertificate
The implementation will download the CA certificate identified by the given ocid from the OCI Certificates Services.- Parameters:
caCertOcid- the ca cert ocid- Returns:
- the downloaded CA certificate
- Throws:
IllegalStateException- if there is any errors loading the key
-
create
static OciCertificatesDownloader.Certificates create(String version, X509Certificate[] certificates) Creates a Certificates instance given its version and array of certificates. The version is used to identify change - the format of the string is immaterial. Only when it changes it will signify the need for reloading.- Parameters:
version- the versioncertificates- the certificates- Returns:
- a certificates wrapper
-
create
static OciCertificatesDownloader.CertificatesWithPrivateKey create(String version, X509Certificate[] certificates, PrivateKey privateKey) Creates a certificate bundle with its matching private key. The first certificate in the array must be the leaf certificate corresponding to the private key.- Parameters:
version- version identifying the downloaded certificate bundlecertificates- leaf-first certificate chainprivateKey- private key matching the leaf certificate- Returns:
- certificate and private-key bundle
-