Package io.micronaut.http.ssl
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 -
Method Summary
Modifier and TypeMethodDescriptionio.netty.pkitesting.CertificateBuilder.Algorithm
Algorithm used to generate the self-signed key pair and certificate (e.g.Validity period of the generated certificate.getName()
X.500 subject distinguished name for the generated certificate, for exampleCN=localhost
.Interval at which a new self-signed certificate is generated and emitted.void
setAlgorithm
(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 exampleCN=localhost
.void
setUpdateInterval
(@NonNull Duration updateInterval) Interval at which a new self-signed certificate is generated and emitted.
-
Constructor Details
-
Config
-
-
Method Details
-
getName
-
getAlgorithm
Algorithm used to generate the self-signed key pair and certificate (e.g. RSA, EC). Controls the cryptographic parameters used byCertificateBuilder
. Defaults torsa4096
.- Returns:
- the certificate generation algorithm
-
setAlgorithm
Algorithm used to generate the self-signed key pair and certificate (e.g. RSA, EC). Controls the cryptographic parameters used byCertificateBuilder
. Defaults torsa4096
.- Parameters:
algorithm
- the certificate generation algorithm
-
getSubject
X.500 subject distinguished name for the generated certificate, for exampleCN=localhost
. This value is passed to the certificate builder and becomes the certificate's subject. Defaults toCN=localhost
.- Returns:
- the subject DN for the certificate
-
setSubject
X.500 subject distinguished name for the generated certificate, for exampleCN=localhost
. This value is passed to the certificate builder and becomes the certificate's subject. Defaults toCN=localhost
.- Parameters:
subject
- the subject DN for the certificate
-
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
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
Validity period of the generated certificate. The certificate'snotAfter
is set to now plus this duration when building the self-signed certificate. Defaults to 7 days.- Returns:
- the certificate lifetime
-
setLifetime
Validity period of the generated certificate. The certificate'snotAfter
is set to now plus this duration when building the self-signed certificate. Defaults to 7 days.- Parameters:
lifetime
- the certificate lifetime
-