getPrivateKeyForConnectionDid method
Returns the private key as hex-String associated with did
.
Implementation
Future<String?> getPrivateKeyForConnectionDid(String did) async {
if (did.startsWith('did:ethr')) {
return _getPrivateKeyForConnectionDidEthr(did);
} else if (did.startsWith('did:key:z6Mk')) {
return _getPrivateKeyForConnectionDidEd(did);
} else if (did.startsWith('did:key:z6LS')) {
return _getPrivateKeyForConnectionDidX(did);
} else {
throw Exception('Unknown KeyType');
}
}