public SecretKey getSecretKey ( String alias , String password ) { Key key = getKey ( alias , password ) ; if ( key instanceof PrivateKey ) { return ( SecretKey ) key ; } else { throw new IllegalStateException ( format ( "Key with alias '%s' was not a secret key, but was: %s" , alias , key . getClass ( ) . getSimpleName ( ) ) ) ; } }
Gets a symmetric encryption secret key from the key store