Class AcmeService

java.lang.Object
io.micronaut.acme.services.AcmeService

@Singleton public class AcmeService extends Object
Service to contact an ACME server and setup a certificate on a given basis.
  • Constructor Details

    • AcmeService

      public AcmeService(io.micronaut.context.event.ApplicationEventPublisher eventPublisher, AcmeConfiguration acmeConfiguration, io.micronaut.core.io.ResourceResolver resourceResolver, @Named("scheduled") io.micronaut.scheduling.TaskScheduler taskScheduler, DnsChallengeSolver dnsChallengeSolver)
      Constructs a new Acme cert service.
      Parameters:
      eventPublisher - Application Event Publisher
      resourceResolver - Resource resolver for finding keys from classpath or disk
      acmeConfiguration - Acme Configuration
      taskScheduler - Task scheduler for enabling background polling of the certificate refreshes
      dnsChallengeSolver - DNS Challenge Resolver for setting up a DNS challenge
  • Method Details

    • getCurrentCertificate

      public X509Certificate getCurrentCertificate()
      Gets the current X509Certificate.
      Returns:
      current domain certificate
    • getFullCertificateChain

      @NonNull protected @NonNull Optional<X509Certificate[]> getFullCertificateChain()
      Returns the full certificate chain.
      Returns:
      array of each of the certificates in the chain
    • orderCertificate

      public void orderCertificate(List<String> domains) throws org.shredzone.acme4j.exception.AcmeException
      Orders a new certificate using ACME protocol.
      Parameters:
      domains - List of domains to order a certificate for
      Throws:
      org.shredzone.acme4j.exception.AcmeException - if any issues occur during ordering of certificate
    • setupCurrentCertificate

      public void setupCurrentCertificate()
      Setup the certificate that has been saved to disk and configures it for use.