Class SelfSignedCertificateExtension
java.lang.Object
com.linecorp.armeria.testing.junit5.common.AbstractAllOrEachExtension
com.linecorp.armeria.testing.junit5.server.SelfSignedCertificateExtension
- All Implemented Interfaces:
AfterAllCallback
,AfterEachCallback
,BeforeAllCallback
,BeforeEachCallback
,Extension
An
Extension
that provides a temporary self-signed certificate.-
Constructor Summary
ConstructorsConstructorDescriptionCreates a new instance.Creates a new instance.SelfSignedCertificateExtension
(String fqdn, SecureRandom random, int bits) Creates a new instance.SelfSignedCertificateExtension
(String fqdn, SecureRandom random, int bits, TemporalAccessor notBefore, TemporalAccessor notAfter) Creates a new instance.SelfSignedCertificateExtension
(String fqdn, TemporalAccessor notBefore, TemporalAccessor notAfter) Creates a new instance.SelfSignedCertificateExtension
(TemporalAccessor notBefore, TemporalAccessor notAfter) Creates a new instance. -
Method Summary
Modifier and TypeMethodDescriptionvoid
after
(ExtensionContext context) Deletes the generated self-signed certificate.void
before
(ExtensionContext context) Generates a self-signed certificate.Returns the generatedX509Certificate
.Returns the self-signed certificate file.Returns thePrivateKey
of the self-signed certificate.Returns the private key file of the self-signed certificate.Methods inherited from class com.linecorp.armeria.testing.junit5.common.AbstractAllOrEachExtension
afterAll, afterEach, beforeAll, beforeEach, runForEachTest
-
Constructor Details
-
SelfSignedCertificateExtension
public SelfSignedCertificateExtension()Creates a new instance. -
SelfSignedCertificateExtension
Creates a new instance.- Parameters:
notBefore
-Certificate
is not valid before this timenotAfter
-Certificate
is not valid after this time
-
SelfSignedCertificateExtension
Creates a new instance.- Parameters:
fqdn
- a fully qualified domain name
-
SelfSignedCertificateExtension
public SelfSignedCertificateExtension(String fqdn, TemporalAccessor notBefore, TemporalAccessor notAfter) Creates a new instance.- Parameters:
fqdn
- a fully qualified domain namenotBefore
-Certificate
is not valid before this timenotAfter
-Certificate
is not valid after this time
-
SelfSignedCertificateExtension
Creates a new instance.- Parameters:
fqdn
- a fully qualified domain namerandom
- theSecureRandom
to usebits
- the number of bits of the generated private key
-
SelfSignedCertificateExtension
public SelfSignedCertificateExtension(String fqdn, SecureRandom random, int bits, TemporalAccessor notBefore, TemporalAccessor notAfter) Creates a new instance.- Parameters:
fqdn
- a fully qualified domain namerandom
- theSecureRandom
to usebits
- the number of bits of the generated private keynotBefore
-Certificate
is not valid before this timenotAfter
-Certificate
is not valid after this time
-
-
Method Details
-
before
Generates a self-signed certificate.- Specified by:
before
in classAbstractAllOrEachExtension
- Throws:
Exception
-
after
Deletes the generated self-signed certificate.- Specified by:
after
in classAbstractAllOrEachExtension
- Throws:
Exception
-
certificate
Returns the generatedX509Certificate
. -
certificateFile
Returns the self-signed certificate file. -
privateKey
Returns thePrivateKey
of the self-signed certificate. -
privateKeyFile
Returns the private key file of the self-signed certificate.
-