Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support for multiple Verifiable Credentials in a Verifiable Presentation #48

Open
robertschubert opened this issue Jun 4, 2024 · 0 comments

Comments

@robertschubert
Copy link

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?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant