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()));
        }
    }
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
@param alias key alias
@param password key password
@return the secret key