def check_keystore_json(jsondata):
 if (('crypto' not in jsondata) and ('Crypto' not in jsondata)):
  return False
 if ('version' not in jsondata):
  return False
 if (jsondata['version'] != 3):
  return False
 crypto = jsondata.get('crypto', jsondata.get('Crypto'))
 if ('cipher' not in crypto):
  return False
 if ('ciphertext' not in crypto):
  return False
 if ('kdf' not in crypto):
  return False
 if ('mac' not in crypto):
  return False
 return True

def check_keystore_json ( jsondata ) : if ( ( 'crypto' not in jsondata ) and ( 'Crypto' not in jsondata ) ) : return False if ( 'version' not in jsondata ) : return False if ( jsondata [ 'version' ] != 3 ) : return False crypto = jsondata . get ( 'crypto' , jsondata . get ( 'Crypto' ) ) if ( 'cipher' not in crypto ) : return False if ( 'ciphertext' not in crypto ) : return False if ( 'kdf' not in crypto ) : return False if ( 'mac' not in crypto ) : return False return True
check if jsondata has the structure of a keystore file version 3 .