aries-framework-go icon indicating copy to clipboard operation
aries-framework-go copied to clipboard

Option to enforce proof requirement for Verifiable Credential?

Open adn-misa opened this issue 3 years ago • 2 comments

What I'm trying to do

I'm trying to enforce the requirement for Verifiable Credential to have embedded proofs.

Expected result

It would be nice to have an option to enforce embedded proofs.

Actual result

It seems to currently not being enforceable as of the following snippet on line 68.

proofElement, ok := jsonldDoc["proof"]
	if !ok || proofElement == nil {
		// do not make a check if there is no proof defined as proof presence is not mandatory
		return docBytes, nil
	}

adn-misa avatar Jan 13 '22 09:01 adn-misa

@adn-misa could you please elaborate what you are trying to do here.

we enforce proof validation in verifiable credential only if it has proof.

For example you want to sign a credential then you to parse one without proof

vc, err := verifiable.ParseCredential(rawBytes)
err = vc.AddLinkedDataProof(...options..)

if we always enforce proof validation then it will fail in first line itself.

sudeshrshetty avatar Jan 20 '22 03:01 sudeshrshetty

@sudeshrshetty my bad, i wasn't clear enough.

What I meant was for an option for ParseCredential to fail when a verifiable credential does not have a proof.

It would also make a good default from a security perspective. The first time using the ValidateCredential API, I thought that it would fail on missing proof. It was later when I verified the source code that I found that behaviour you mentioned on missing proofs.

From my view, I don't see a lot of use cases for verifiable credentials without proofs. I would appreciate your view of the issues.

adn-misa avatar Jan 20 '22 07:01 adn-misa