Search in sources :

Example 1 with AlternativeName

use of org.apache.qpid.test.utils.tls.AlternativeName in project qpid-broker-j by apache.

the class SNITest method setUp.

@Before
public void setUp() throws Exception {
    final Instant yesterday = Instant.now().minus(1, ChronoUnit.DAYS);
    final Instant inOneHour = Instant.now().plus(1, ChronoUnit.HOURS);
    _fooValid = TlsResourceBuilder.createSelfSigned("CN=foo", yesterday, yesterday.plus(365, ChronoUnit.DAYS));
    _fooInvalid = TlsResourceBuilder.createSelfSigned("CN=foo", inOneHour, inOneHour.plus(365, ChronoUnit.DAYS));
    _barInvalid = TlsResourceBuilder.createSelfSigned("CN=Qpid", inOneHour, inOneHour.plus(365, ChronoUnit.DAYS), new AlternativeName(AltNameType.DNS_NAME, "bar"));
    _keyStoreFile = TLS_RESOURCE.createKeyStore(new PrivateKeyEntry("foovalid", _fooValid.getPrivateKey(), _fooValid.getCertificate()), new PrivateKeyEntry("fooinvalid", _fooInvalid.getPrivateKey(), _fooInvalid.getCertificate()), new PrivateKeyEntry("barinvalid", _barInvalid.getPrivateKey(), _barInvalid.getCertificate())).toFile();
}
Also used : Instant(java.time.Instant) PrivateKeyEntry(org.apache.qpid.test.utils.tls.PrivateKeyEntry) AlternativeName(org.apache.qpid.test.utils.tls.AlternativeName) Before(org.junit.Before)

Aggregations

Instant (java.time.Instant)1 AlternativeName (org.apache.qpid.test.utils.tls.AlternativeName)1 PrivateKeyEntry (org.apache.qpid.test.utils.tls.PrivateKeyEntry)1 Before (org.junit.Before)1