Class SelfSignedCertificateProvider.Config

java.lang.Object
io.micronaut.http.ssl.SelfSignedCertificateProvider.Config
All Implemented Interfaces:
Named
Enclosing class:
SelfSignedCertificateProvider

@EachProperty("micronaut.certificate.self-signed") public static final class SelfSignedCertificateProvider.Config extends Object implements Named
Certificate provider that creates self-signed certificates using netty-pkitesting.
  • Constructor Summary

    Constructors
    Constructor
    Description
    Config(@NonNull String name)
     
  • Method Summary

    Modifier and Type
    Method
    Description
    @NonNull io.netty.pkitesting.CertificateBuilder.Algorithm
    Algorithm used to generate the self-signed key pair and certificate (e.g.
    @NonNull Duration
    Validity period of the generated certificate.
    @NonNull String
     
    @NonNull String
    X.500 subject distinguished name for the generated certificate, for example CN=localhost.
    @NonNull Duration
    Interval at which a new self-signed certificate is generated and emitted.
    void
    setAlgorithm(@NonNull io.netty.pkitesting.CertificateBuilder.Algorithm algorithm)
    Algorithm used to generate the self-signed key pair and certificate (e.g.
    void
    setLifetime(@NonNull Duration lifetime)
    Validity period of the generated certificate.
    void
    setSubject(@NonNull String subject)
    X.500 subject distinguished name for the generated certificate, for example CN=localhost.
    void
    setUpdateInterval(@NonNull Duration updateInterval)
    Interval at which a new self-signed certificate is generated and emitted.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

  • Method Details

    • getName

      public @NonNull String getName()
      Specified by:
      getName in interface Named
      Returns:
      The name of the component
    • getAlgorithm

      public @NonNull io.netty.pkitesting.CertificateBuilder.Algorithm getAlgorithm()
      Algorithm used to generate the self-signed key pair and certificate (e.g. RSA, EC). Controls the cryptographic parameters used by CertificateBuilder. Defaults to rsa4096.
      Returns:
      the certificate generation algorithm
    • setAlgorithm

      public void setAlgorithm(@NonNull io.netty.pkitesting.CertificateBuilder.Algorithm algorithm)
      Algorithm used to generate the self-signed key pair and certificate (e.g. RSA, EC). Controls the cryptographic parameters used by CertificateBuilder. Defaults to rsa4096.
      Parameters:
      algorithm - the certificate generation algorithm
    • getSubject

      public @NonNull String getSubject()
      X.500 subject distinguished name for the generated certificate, for example CN=localhost. This value is passed to the certificate builder and becomes the certificate's subject. Defaults to CN=localhost.
      Returns:
      the subject DN for the certificate
    • setSubject

      public void setSubject(@NonNull String subject)
      X.500 subject distinguished name for the generated certificate, for example CN=localhost. This value is passed to the certificate builder and becomes the certificate's subject. Defaults to CN=localhost.
      Parameters:
      subject - the subject DN for the certificate
    • getUpdateInterval

      public @NonNull Duration getUpdateInterval()
      Interval at which a new self-signed certificate is generated and emitted. Used to schedule periodic regeneration via a fixed-rate task so updated material is picked up automatically. Defaults to 1 day.
      Returns:
      the certificate regeneration interval
    • setUpdateInterval

      public void setUpdateInterval(@NonNull Duration updateInterval)
      Interval at which a new self-signed certificate is generated and emitted. Used to schedule periodic regeneration via a fixed-rate task so updated material is picked up automatically. Defaults to 1 day.
      Parameters:
      updateInterval - the certificate regeneration interval
    • getLifetime

      public @NonNull Duration getLifetime()
      Validity period of the generated certificate. The certificate's notAfter is set to now plus this duration when building the self-signed certificate. Defaults to 7 days.
      Returns:
      the certificate lifetime
    • setLifetime

      public void setLifetime(@NonNull Duration lifetime)
      Validity period of the generated certificate. The certificate's notAfter is set to now plus this duration when building the self-signed certificate. Defaults to 7 days.
      Parameters:
      lifetime - the certificate lifetime