Keys
Public Key
PublicKey publicKey(KeyStore keystore, String alias);Usage Example
KeyStore keystore = keystore("classpath:keystore.p12", "password".toCharArray(), "PKCS12");
PublicKey publicKey = publicKey(keystore, "alice");Private Key
PrivateKey privateKey(KeyStore keystore, String alias, char[] password);
PrivateKey privateKey(KeyStore keystore, String alias, String password);Usage Example
KeyStore keystore = keystore("classpath:keystore.p12", "password".toCharArray(), "PKCS12");
PrivateKey privateKey = privateKey(keystore, "alice", "password".toCharArray());
// or with String convenience overload:
PrivateKey privateKey = privateKey(keystore, "alice", "password");Secret Key
Usage Example
Symmetric Key
Usage Examples
Key Pair
Usage Example
Key Pair with Custom PRNG
Usage Example
Last updated
Was this helpful?