public Key engineGetKey(String alias, char[] password)
      throws UnrecoverableKeyException
   {
      if (!loaded) {
         throw NOT_LOADED;
      }
      if (keyring == null) {
         return null;
      }
      if (!(keyring instanceof IPrivateKeyring)) {
         throw new IllegalStateException("not a private keyring");
      }
      if (password == null) {
         if (((IPrivateKeyring) keyring).containsPublicKey(alias)) {
            return ((IPrivateKeyring) keyring).getPublicKey(alias);
         }
      }
      if (((IPrivateKeyring) keyring).containsPrivateKey(alias)) {
         return ((IPrivateKeyring) keyring).getPrivateKey(alias, password);
      }
      return null;
   }