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 TypeMethodDescriptionvoidafter(ExtensionContext context) Deletes the generated self-signed certificate.voidbefore(ExtensionContext context) Generates a self-signed certificate.Returns the generatedX509Certificate.Returns the self-signed certificate file.Returns thePrivateKeyof 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-Certificateis not valid before this timenotAfter-Certificateis 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-Certificateis not valid before this timenotAfter-Certificateis not valid after this time
-
SelfSignedCertificateExtension
Creates a new instance.- Parameters:
fqdn- a fully qualified domain namerandom- theSecureRandomto 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- theSecureRandomto usebits- the number of bits of the generated private keynotBefore-Certificateis not valid before this timenotAfter-Certificateis not valid after this time
-
-
Method Details
-
before
Generates a self-signed certificate.- Specified by:
beforein classAbstractAllOrEachExtension- Throws:
Exception
-
after
Deletes the generated self-signed certificate.- Specified by:
afterin classAbstractAllOrEachExtension- Throws:
Exception
-
certificate
Returns the generatedX509Certificate. -
certificateFile
Returns the self-signed certificate file. -
privateKey
Returns thePrivateKeyof the self-signed certificate. -
privateKeyFile
Returns the private key file of the self-signed certificate.
-