Added verify_presentation bindings
This commit is contained in:
parent
ac588d4d84
commit
1f54d806ab
|
@ -1 +1,2 @@
|
||||||
.idea/
|
.idea/
|
||||||
|
__pycache__
|
||||||
|
|
|
@ -83,3 +83,14 @@ def issue_verifiable_presentation(vc_list: list[str], jwk_holder: str, holder_di
|
||||||
return asyncio.run(inner())
|
return asyncio.run(inner())
|
||||||
|
|
||||||
|
|
||||||
|
def verify_presentation(vp):
|
||||||
|
"""
|
||||||
|
Returns a (bool, str) tuple indicating whether the credential is valid.
|
||||||
|
If the boolean is true, the credential is valid and the second argument can be ignored.
|
||||||
|
If it is false, the VC is invalid and the second argument contains a JSON object with further information.
|
||||||
|
"""
|
||||||
|
async def inner():
|
||||||
|
proof_options = '{"proofFormat": "ldp"}'
|
||||||
|
return didkit.verify_presentation(vp, proof_options)
|
||||||
|
|
||||||
|
return asyncio.run(inner())
|
||||||
|
|
9
main.py
9
main.py
|
@ -34,6 +34,15 @@ def issue_vc_test():
|
||||||
|
|
||||||
|
|
||||||
def issue_vp_test():
|
def issue_vp_test():
|
||||||
|
"""
|
||||||
|
In this example execution two Verifiable Credentials associated with a single Holder are issued and then
|
||||||
|
combined into a single Verifiable Presentation.
|
||||||
|
The Verifiable Credentials are of two different models. The use-case is meant to mimic
|
||||||
|
- Holder being a physical person,
|
||||||
|
- Issuer A being "Pare Manel" foundation,
|
||||||
|
- Issuer B being "EXO" foundation,
|
||||||
|
- Verifier (not pictured) being "Som Connexio", which wants verifiable data of the Holder from both Issuers.
|
||||||
|
"""
|
||||||
jwk_issuer = didkit.generate_ed25519_key()
|
jwk_issuer = didkit.generate_ed25519_key()
|
||||||
jwk_issuer2 = didkit.generate_ed25519_key()
|
jwk_issuer2 = didkit.generate_ed25519_key()
|
||||||
jwk_subject = didkit.generate_ed25519_key()
|
jwk_subject = didkit.generate_ed25519_key()
|
||||||
|
|
Reference in New Issue