Interface CertificateProvider

All Superinterfaces:
Named
All Known Implementing Classes:
FileCertificateProvider, ResourceCertificateProvider, SelfSignedCertificateProvider

public interface CertificateProvider extends Named
Provides access to certificate material as KeyStore instances that can be consumed by SSL context builders. Implementations may actively refresh and emit new keystores when underlying sources change.
Since:
4.10.0
Author:
Jonas Konrad
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    static final String
     
  • Method Summary

    Modifier and Type
    Method
    Description
    @NonNull Publisher<@NonNull KeyStore>
    Publisher that emits the key store containing private key and/or certificates.
    default @NonNull Publisher<@NonNull KeyStore>
    Publisher that emits the trust store with trusted certificates.

    Methods inherited from interface io.micronaut.core.naming.Named

    getName
  • Field Details

  • Method Details

    • getKeyStore

      @NonNull Publisher<@NonNull KeyStore> getKeyStore()
      Publisher that emits the key store containing private key and/or certificates. To avoid weird initialization issues, it is highly recommended to return a publisher here that produces a key store immediately upon subscription, on the subscribing thread. This avoids race conditions where e.g. a server starts up before a key store is available, and there is a short interval where SSL connections will fail.
      Returns:
      a publisher of KeyStore updates
    • getTrustStore

      default @NonNull Publisher<@NonNull KeyStore> getTrustStore()
      Publisher that emits the trust store with trusted certificates. By default, this returns getKeyStore().
      Returns:
      a publisher of KeyStore updates for trust material