getHolderDidFromCredential function
Collects the did of the Holder of credential
.
Implementation
String getHolderDidFromCredential(dynamic credential) {
var credMap = credentialToMap(credential);
if (credMap.containsKey('credentialSubject')) {
if (credMap['credentialSubject'].containsKey('id')) {
return credMap['credentialSubject']['id'];
} else {
return '';
}
} else if (credMap.containsKey('id')) {
return credMap['id'];
} else {
return '';
}
}