Code example for KeyStore

Methods: getKey

0
    } 
 
    /** {@inheritDoc} */ 
    public PrivateKey getPrivateKey() {
        try { 
            return (PrivateKey) keyStore.getKey(credentialAlias, keyPassword);
        } catch (Exception e) {
            log.error("Error accessing {} private key in keystore", e);
            return null; 
        } 
    } 
 
    /** {@inheritDoc} */ 
    public PublicKey getPublicKey() {
        return getEntityCertificate().getPublicKey();
    } 
}