use of org.teknux.jettybootstrap.keystore.JettyKeystoreConvertorBuilder in project jetty-bootstrap by teknux-org.
the class JettyKeystoreConvertorBuilderTest method do08P12Test.
@Test
public void do08P12Test() throws JettyKeystoreException, InvalidKeyException, KeyStoreException, CertificateException, NoSuchAlgorithmException, NoSuchProviderException, SignatureException {
InputStream inputStream = getClass().getResourceAsStream("/org/teknux/jettybootstrap/test/keystore/pkcs12/test.p12");
JettyKeystoreConvertorBuilder jettyKeystoreConvertorBuilder = new JettyKeystoreConvertorBuilder().setPKCS12(inputStream, "test");
jettyKeystoreConvertorBuilder.checkValidity(true, true);
KeyStore keystore = jettyKeystoreConvertorBuilder.build(KEYSTORE_ALIAS, KEYSTORE_PASSWORD);
JettyKeystoreConvertorBuilder.checkValidity(keystore, KEYSTORE_ALIAS, true, true);
}
use of org.teknux.jettybootstrap.keystore.JettyKeystoreConvertorBuilder in project jetty-bootstrap by teknux-org.
the class JettyKeystoreConvertorBuilderTest method do09KeyAndP12Test.
@Test
public void do09KeyAndP12Test() throws JettyKeystoreException, InvalidKeyException, KeyStoreException, CertificateException, NoSuchAlgorithmException, NoSuchProviderException, SignatureException {
InputStream keyInputStream = getClass().getResourceAsStream("/org/teknux/jettybootstrap/test/keystore/pkcs12/test.key");
InputStream crtInputStream = getClass().getResourceAsStream("/org/teknux/jettybootstrap/test/keystore/pkcs12/test.p12");
JettyKeystoreConvertorBuilder jettyKeystoreConvertorBuilder = new JettyKeystoreConvertorBuilder().setPrivateKeyFromPKCS8(keyInputStream).setCertificateFromPKCS12(crtInputStream, "test");
jettyKeystoreConvertorBuilder.checkValidity(true, true);
KeyStore keystore = jettyKeystoreConvertorBuilder.build(KEYSTORE_ALIAS, KEYSTORE_PASSWORD);
JettyKeystoreConvertorBuilder.checkValidity(keystore, KEYSTORE_ALIAS, true, true);
}
use of org.teknux.jettybootstrap.keystore.JettyKeystoreConvertorBuilder in project jetty-bootstrap by teknux-org.
the class JettyKeystoreConvertorBuilderTest method do05KeyAndCrtTest.
@Test
public void do05KeyAndCrtTest() throws JettyKeystoreException, InvalidKeyException, KeyStoreException, CertificateException, NoSuchAlgorithmException, NoSuchProviderException, SignatureException {
InputStream keyInputStream = getClass().getResourceAsStream("/org/teknux/jettybootstrap/test/keystore/pkcs8/test.key");
InputStream crtInputStream = getClass().getResourceAsStream("/org/teknux/jettybootstrap/test/keystore/pkcs8/test.crt");
JettyKeystoreConvertorBuilder jettyKeystoreConvertorBuilder = new JettyKeystoreConvertorBuilder().setPrivateKeyFromPKCS8(keyInputStream).setCertificateFromPKCS8(crtInputStream);
jettyKeystoreConvertorBuilder.checkValidity(true, true);
KeyStore keystore = jettyKeystoreConvertorBuilder.build(KEYSTORE_ALIAS, KEYSTORE_PASSWORD);
JettyKeystoreConvertorBuilder.checkValidity(keystore, KEYSTORE_ALIAS, true, true);
}
use of org.teknux.jettybootstrap.keystore.JettyKeystoreConvertorBuilder in project jetty-bootstrap by teknux-org.
the class JettyKeystoreConvertorBuilderTest method do04PemTest.
@Test
public void do04PemTest() throws JettyKeystoreException, InvalidKeyException, KeyStoreException, CertificateException, NoSuchAlgorithmException, NoSuchProviderException, SignatureException {
InputStream inputStream = getClass().getResourceAsStream("/org/teknux/jettybootstrap/test/keystore/pkcs8/test.pem");
JettyKeystoreConvertorBuilder jettyKeystoreConvertorBuilder = new JettyKeystoreConvertorBuilder().setPKCS8(inputStream);
jettyKeystoreConvertorBuilder.checkValidity(true, true);
KeyStore keystore = jettyKeystoreConvertorBuilder.build(KEYSTORE_ALIAS, "test");
JettyKeystoreConvertorBuilder.checkValidity(keystore, KEYSTORE_ALIAS, true, true);
}
use of org.teknux.jettybootstrap.keystore.JettyKeystoreConvertorBuilder in project jetty-bootstrap by teknux-org.
the class JettyKeystoreConvertorBuilderTest method do07PemAndCrtTest.
@Test
public void do07PemAndCrtTest() throws JettyKeystoreException, InvalidKeyException, KeyStoreException, CertificateException, NoSuchAlgorithmException, NoSuchProviderException, SignatureException {
InputStream keyInputStream = getClass().getResourceAsStream("/org/teknux/jettybootstrap/test/keystore/pkcs8/test.pem");
InputStream crtInputStream = getClass().getResourceAsStream("/org/teknux/jettybootstrap/test/keystore/pkcs8/test.crt");
JettyKeystoreConvertorBuilder jettyKeystoreConvertorBuilder = new JettyKeystoreConvertorBuilder().setPrivateKeyFromPKCS8(keyInputStream).setCertificateFromPKCS8(crtInputStream);
jettyKeystoreConvertorBuilder.checkValidity(true, true);
KeyStore keystore = jettyKeystoreConvertorBuilder.build(KEYSTORE_ALIAS, KEYSTORE_PASSWORD);
JettyKeystoreConvertorBuilder.checkValidity(keystore, KEYSTORE_ALIAS, true, true);
}
Aggregations