Modifier and Type | Method and Description |
---|---|
static Key |
getKey(KeyStore keyStore,
String alias,
String password)
|
static Key |
getPublicKey(KeyStore keyStore,
String alias,
String password)
Retrieve the public key from the keystore: it could be a certificate or a
symmetric key.
|
public static Key getKey(KeyStore keyStore, String alias, String password)
keyStore
- The storage facility for cryptographic keys and certificates to search for the given key.alias
- The alias associated with the key.password
- The password for recovering the key.Key
or an IllegalArgumentException
if it fails.IllegalArgumentException
- If the key was not retrieved or if an exception occurred.public static Key getPublicKey(KeyStore keyStore, String alias, String password)
keyStore
- The keystore where to find the key.alias
- The alias associated with the key.password
- The keystore password, could be null
if the key is not symmetric.
(Only symmetric key, SecretKey
will require a password).Copyright 2011-2017 ForgeRock AS.