decryptAuth function

Future<String> decryptAuth({
  1. String? account,
  2. Signer? signer,
  3. required dynamic additionalMeta,
  4. Function? progressHook,
})

Implementation

Future<String> decryptAuth({
  String? account,
  Signer? signer,
  required additionalMeta,
  Function? progressHook,
}) async {
  if (account == null && signer == null) {
    throw Exception('At least one from account or signer is necessary!');
  }
  final wallet = getWallet(address: account, signer: signer);

  final encryptedPGPPrivateKey =
      additionalMeta['NFTPGP_V1']['encryptedPassword'];
  final password = await decryptPGPKey(
    encryptedPGPPrivateKey: encryptedPGPPrivateKey as String,
    wallet: wallet,
    progressHook: progressHook,
  );

  return password;
}