decryptContact method
Implementation
Future<DecryptedContactDto> decryptContact(String myId, ContactDto contact) async {
final es = contact.encryptedSelf;
if (es != null) {
final secret = (await this.crypto.decryptEncryptionKeys(myId, contact.encryptionKeys)).firstOrNull?.formatAsKey().fromHexString();
if (secret == null) {
throw FormatException("Cannot get encryption key fo ${contact.id} and hcp $myId");
}
return this.unmarshaller(contact, base64.decoder.convert(es).decryptAES(secret));
} else {
return this.unmarshaller(contact, null);
}
}