Class SelfSignedCertificateRule

java.lang.Object
org.junit.rules.ExternalResource
com.linecorp.armeria.testing.junit4.server.SelfSignedCertificateRule
All Implemented Interfaces:
TestRule

public final class SelfSignedCertificateRule
extends ExternalResource
A TestRule that provides a temporary self-signed certificate.
  • Constructor Details

    • SelfSignedCertificateRule

      public SelfSignedCertificateRule()
      Creates a new instance.
    • SelfSignedCertificateRule

      public SelfSignedCertificateRule​(TemporalAccessor notBefore, TemporalAccessor notAfter)
      Creates a new instance.
      Parameters:
      notBefore - Certificate is not valid before this time
      notAfter - Certificate is not valid after this time
    • SelfSignedCertificateRule

      public SelfSignedCertificateRule​(String fqdn)
      Creates a new instance.
      Parameters:
      fqdn - a fully qualified domain name
    • SelfSignedCertificateRule

      public SelfSignedCertificateRule​(String fqdn, TemporalAccessor notBefore, TemporalAccessor notAfter)
      Creates a new instance.
      Parameters:
      fqdn - a fully qualified domain name
      notBefore - Certificate is not valid before this time
      notAfter - Certificate is not valid after this time
    • SelfSignedCertificateRule

      public SelfSignedCertificateRule​(String fqdn, SecureRandom random, int bits)
      Creates a new instance.
      Parameters:
      fqdn - a fully qualified domain name
      random - the SecureRandom to use
      bits - the number of bits of the generated private key
    • SelfSignedCertificateRule

      public SelfSignedCertificateRule​(String fqdn, SecureRandom random, int bits, TemporalAccessor notBefore, TemporalAccessor notAfter)
      Creates a new instance.
      Parameters:
      fqdn - a fully qualified domain name
      random - the SecureRandom to use
      bits - the number of bits of the generated private key
      notBefore - Certificate is not valid before this time
      notAfter - Certificate is not valid after this time
  • Method Details