secp256k1KeyIdentityFromPem function
Implementation
Future<Secp256k1KeyIdentity> secp256k1KeyIdentityFromPem(String pem) async {
try {
var pem2 = CryptoUtils.BEGIN_EC_PRIVATE_KEY + pem;
var key = CryptoUtils.ecPrivateKeyFromPem(pem2).d;
var prvU8a = key!.toU8a();
return Secp256k1KeyIdentity.fromSecretKey(prvU8a);
} catch (e) {
rethrow;
}
}