-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #72 from blockchain-certificates/feat/align-data-i…
…ntegrity-proof feat(DataIntegrityProof): enable verification of data integrity proof
- Loading branch information
Showing
4 changed files
with
75 additions
and
26 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
{ | ||
"@context": [ | ||
"https://www.w3.org/ns/credentials/v2", | ||
"https://w3id.org/security/data-integrity/v2", | ||
"https://w3id.org/blockcerts/v3.1" | ||
], | ||
"id": "urn:uuid:bbba8553-8ec1-445f-82c9-a57251dd731c", | ||
"type": [ | ||
"VerifiableCredential", | ||
"BlockcertsCredential" | ||
], | ||
"issuer": "https://www.blockcerts.org/samples/3.0/issuer-blockcerts.json", | ||
"validFrom": "2022-07-13T20:21:40.088Z", | ||
"validUntil": "2039-07-13T00:00:00.000Z", | ||
"credentialSubject": { | ||
"id": "did:example:ebfeb1f712ebc6f1c276e12ec21", | ||
"name": "Julien Fraichot", | ||
"email": "[email protected]", | ||
"publicKey": "ecdsa-koblitz-pubkey:1BPQXndcz5Uf3qZQkgnvJC87LUD5n7a2mC", | ||
"claim": { | ||
"name": "Master of Puppets", | ||
"description": "Awarded to those who rock" | ||
} | ||
}, | ||
"metadata": "{\"classOf\":\"2021\"}", | ||
"display": { | ||
"contentMediaType": "text/html", | ||
"content": "<div style=\"background-color:transparent;padding:6px;display:inline-flex;align-items:center;flex-direction:column\">Yo</div>" | ||
}, | ||
"proof": { | ||
"id": "urn:uuid:a68a8c11-556b-42dc-b840-55677639db7d", | ||
"type": "DataIntegrityProof", | ||
"cryptosuite": "merkle-proof-2019", | ||
"proofPurpose": "assertionMethod", | ||
"created": "2024-02-15T15:22:35.361231", | ||
"proofValue": "zEuZQLZTYrdsDv2FbpkZtthsgpG54RGrfTSvyUNDGi1ecmJdY9KMtFSxbbs6pEspqa38GgXJD9ReRosEBrXsXKu4Nk7xMGnm6wfzuCUiwwBCXKrfs8e8r6a1gbyXbzifiJprkeVD9UtaVtdb5QXKHPRikuQR8F9epBejTF7MfQukr1T5U7mZ8nSuKXDJ5epzg6mCANdCFt8ZrYZiLUZGrWpd33BfeuyaJxSGYcfMgjzJGvLnoZpAXHi1MWpNFhxxuTn6BtUbivTJqQhgzUDoXaErWeMEe1z8wRR5TgzNaoULxGp", | ||
"verificationMethod": "https://www.blockcerts.org/samples/3.0/issuer-blockcerts.json#key-1" | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
import fixture from '../fixtures/mocknet-vc-v2-data-integrity-proof.json'; | ||
import { LDMerkleProof2019 } from '../../src'; | ||
|
||
describe('given the documnet is signed following the DataIntegrityProof spec', function () { | ||
describe('and is a valid MerkleProof2019 signature', function () { | ||
it('should verify successfully', async function () { | ||
const instance = new LDMerkleProof2019({ | ||
document: fixture, | ||
proof: fixture.proof // merkle proof | ||
}); | ||
const result = await instance.verifyProof(); | ||
expect(result).toEqual({ | ||
verified: true, | ||
verificationMethod: null, | ||
error: '' | ||
}); | ||
}); | ||
}); | ||
}); |