-
Notifications
You must be signed in to change notification settings - Fork 21
Description
This issue strongly relates to this issue
The current implementation assumes to have one Verifiable Credential inside a Verifiable Presentation. The Builder component inside the VerifiablePresentation class has an attribute verifiableCredential instead of a List.
Moreover the getVerifiableCredential() method will fail if the presentation has more than one `` Verifiable Credential:
public VerifiableCredential getVerifiableCredential() {
Object verifiableCredentialObject = this.getJsonObject().get(VerifiableCredentialKeywords.JSONLD_TERM_VERIFIABLECREDENTIAL);
if ((verifiableCredentialObject instanceof List<?> && ! ((List<?>) verifiableCredentialObject).isEmpty() && ((List<?>) verifiableCredentialObject).get(0) instanceof Map)) {
return VerifiableCredential.getFromJsonLDObject(this);
} else if (verifiableCredentialObject instanceof Map) {
return VerifiableCredential.getFromJsonLDObject(this);
}
return null;
}The code produces an error when we are in the case of the verifiableCredentialObject instanceof List
The class VerifiableCredential should have another method like this to be called in the List case:
public static Set<VerifiableCredential> getFromJsonLDObject(JsonLDObject jsonLdObject)
which iterates over the List.
Are you planning to merge the PR mentioned in the other issue?
Are you planning to support multiple VCs in a VP?