@Contract public interface OciCertificatesDownloader
The contract used for downloading certificates from OCI.
  • Method Details

    • loadCertificates

      OciCertificatesDownloader.Certificates loadCertificates(String certOcid)
      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 bundle
      IllegalStateException - if there are any errors loading the certificate or key
      See Also:
    • loadCACertificate

      X509Certificate loadCACertificate(String caCertOcid)
      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 version
      certificates - 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 bundle
      certificates - leaf-first certificate chain
      privateKey - private key matching the leaf certificate
      Returns:
      certificate and private-key bundle