getPublicKeyFromString function
Implementation
String getPublicKeyFromString(String pgpPublicKeyString) {
if (pgpPublicKeyString.isEmpty) {
return pgpPublicKeyString;
}
dynamic pgpPublicKeyJson;
try {
pgpPublicKeyJson = jsonDecode(pgpPublicKeyString);
pgpPublicKeyJson = pgpPublicKeyJson["key"] ?? pgpPublicKeyString;
return pgpPublicKeyJson;
} catch (error) {
return pgpPublicKeyString;
}
}