use of io.vertx.core.net.PemKeyCertOptions in project vert.x by eclipse.
the class KeyStoreHelperTest method testKeyStoreHelperSupportsRSAPrivateKeys.
/**
* Verifies that the key store helper can read a PKCS#8 encoded RSA private key
* from a PEM file.
*
* @throws Exception if the key cannot be read.
*/
@Test
public void testKeyStoreHelperSupportsRSAPrivateKeys() throws Exception {
PemKeyCertOptions options = new PemKeyCertOptions().addKeyPath("target/test-classes/tls/server-key.pem").addCertPath("target/test-classes/tls/server-cert.pem");
KeyStoreHelper helper = options.getHelper(vertx);
assertKeyType(helper.store(), RSAPrivateKey.class);
}
use of io.vertx.core.net.PemKeyCertOptions in project vert.x by eclipse.
the class KeyStoreHelperTest method testKeyStoreHelperSupportsECPrivateKeys.
/**
* Verifies that the key store helper can read a PKCS#8 encoded EC private key
* from a PEM file.
*
* @throws Exception if the key cannot be read.
*/
@Test
public void testKeyStoreHelperSupportsECPrivateKeys() throws Exception {
Assume.assumeTrue("ECC is not supported by VM's security providers", isECCSupportedByVM());
PemKeyCertOptions options = new PemKeyCertOptions().addKeyPath("target/test-classes/tls/server-key-ec.pem").addCertPath("target/test-classes/tls/server-cert-ec.pem");
KeyStoreHelper helper = options.getHelper(vertx);
assertKeyType(helper.store(), ECPrivateKey.class);
}
Aggregations