@Override public boolean checkAESKey(KeyParameter aesKey){
  lock.lock();
  try {
    if (hashToKeys.isEmpty())     return false;
    checkState(keyCrypter != null,"Key chain is not encrypted");
    ECKey first=null;
    for (    ECKey key : hashToKeys.values()) {
      if (key.isEncrypted()) {
        first=key;
        break;
      }
    }
    checkState(first != null,"No encrypted keys in the wallet");
    try {
      ECKey rebornKey=first.decrypt(aesKey);
      return Arrays.equals(first.getPubKey(),rebornKey.getPubKey());
    }
 catch (    KeyCrypterException e) {
      return false;
    }
  }
  finally {
    lock.unlock();
  }
}

@ Override public boolean checkAESKey ( KeyParameter aesKey ) { lock . lock ( ) ; try { if ( hashToKeys . isEmpty ( ) ) return false ; checkState ( keyCrypter != null , "Key chain is not encrypted" ) ; ECKey first = null ; for ( ECKey key : hashToKeys . values ( ) ) { if ( key . isEncrypted ( ) ) { first = key ; break ; } } checkState ( first != null , "No encrypted keys in the wallet" ) ; try { ECKey rebornKey = first . decrypt ( aesKey ) ; return Arrays . equals ( first . getPubKey ( ) , rebornKey . getPubKey ( ) ) ; } catch ( KeyCrypterException e ) { return false ; } } finally { lock . unlock ( ) ; } }
check whether the aes key can decrypt the first encrypted key in the wallet .
