Skip to content

Commit

Permalink
add static vector
Browse files Browse the repository at this point in the history
Signed-off-by: PatStLouis <[email protected]>
  • Loading branch information
PatStLouis authored and BigBlueHat committed Dec 2, 2024
1 parent f2749a8 commit 6df22b8
Show file tree
Hide file tree
Showing 2 changed files with 39 additions and 12 deletions.
14 changes: 2 additions & 12 deletions tests/10-vc-di.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,12 @@
* Copyright (c) 2022 Digital Bazaar, Inc. All rights reserved.
*/
import {
createInitialVc,
createRequestBody,
testBadRequestError
} from './helpers.js';
import chai from 'chai';
import {ed25519Vector} from './vectors.js';
import {filterByTag} from 'vc-test-suite-implementations';
import {issuerName} from './test-config.js';
import {klona} from 'klona';

const should = chai.should();
Expand All @@ -18,10 +17,6 @@ const tag = 'vc-api';
const {
match: matchingVerifiers
} = filterByTag({property: 'verifiers', tags: [tag]});
const {match: matchingIssuers} = filterByTag({
property: 'issuers',
tags: [tag]
});

describe('Verify Credential - Data Integrity', function() {
const summaries = new Set();
Expand All @@ -40,12 +35,7 @@ describe('Verify Credential - Data Integrity', function() {
const verifier = verifiers.find(
verifier => verifier.tags.has(tag));
describe(verifierName, function() {
let validVc;
before(async function() {
const issuer = matchingIssuers.get(issuerName).issuers.find(
issuer => issuer.tags.has('vc-api'));
validVc = await createInitialVc({issuer});
});
const validVc = ed25519Vector;
it('MUST verify a valid VC.', async function() {
// this tells the test report which cell in the interop matrix
// the result goes in
Expand Down
37 changes: 37 additions & 0 deletions tests/vectors.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
/*!
* Copyright (c) 2024 Digital Bazaar, Inc. All rights reserved.
*/
/* Note: This file contains data generated from the vc-di-ecdsa specification
test vectors. */

/* eslint-disable max-len */
/* eslint-disable quote-props */
/* eslint-disable quotes */

export const ed25519Vector = {
"@context": [
"https://www.w3.org/ns/credentials/v2",
"https://www.w3.org/ns/credentials/examples/v2",
"https://w3id.org/security/suites/ed25519-2020/v1"
],
"id": "urn:uuid:58172aac-d8ba-11ed-83dd-0b3aef56cc33",
"type": [
"VerifiableCredential",
"AlumniCredential"
],
"name": "Alumni Credential",
"description": "A minimum viable example of an Alumni Credential.",
"issuer": "https://vc.example/issuers/5678",
"validFrom": "2023-01-01T00:00:00Z",
"credentialSubject": {
"id": "did:example:abcdefgh",
"alumniOf": "The School of Examples"
},
"proof": {
"type": "Ed25519Signature2020",
"created": "2023-02-24T23:36:38Z",
"verificationMethod": "did:key:z6MkrJVnaZkeFzdQyMZu1cgjg7k1pZZ6pvBQ7XJPt4swbTQ2#z6MkrJVnaZkeFzdQyMZu1cgjg7k1pZZ6pvBQ7XJPt4swbTQ2",
"proofPurpose": "assertionMethod",
"proofValue": "z57Mm1vboMtZiCyJ4aReZsv8co4Re64Y8GEjL1ZARzMbXZgkARFLqFs1P345NpPGG2hgCrS4nNdvJhpwnrNyG3kEF"
}
};

0 comments on commit 6df22b8

Please sign in to comment.