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 static vector #45

Merged
merged 1 commit into from
Dec 2, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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"
}
};
Loading