Documentation

Verifying a credential yourself

Checking a signature with no code of ours involved.

The point of a standard is that you do not have to take our word for anything.

1. Fetch the credential

GET /openbadge/v3/{key}/credential.json

2. Resolve the issuer

proof.verificationMethod names a key, like did:web:api.example.com:openbadge:v3:issuers:{id}#key-0. The did:web method says where that resolves: https://api.example.com/openbadge/v3/issuers/{id}/did.json.

The document publishes every non-revoked key as a Multikey with its publicKeyMultibase, and lists them under assertionMethod.

3. Verify

Any eddsa-rdfc-2022 implementation. With Digital Bazaar's libraries:

import * as Ed25519Multikey from '@digitalbazaar/ed25519-multikey';
import { DataIntegrityProof } from '@digitalbazaar/data-integrity';
import { cryptosuite } from '@digitalbazaar/eddsa-rdfc-2022-cryptosuite';
import jsigs from 'jsonld-signatures';

const key = await Ed25519Multikey.from(verificationMethodFromDidDocument);
const result = await jsigs.verify(credential, {
  suite: new DataIntegrityProof({ cryptosuite, verificationKey: key }),
  purpose: new jsigs.purposes.AssertionProofPurpose(),
  documentLoader,
});

This exact check runs in our own test suite against a credential this server served and a DID document it published over HTTP — and against one altered afterwards, which it rejects.

Checking the PDF instead

The Open Badges credential says a credential was issued. It says nothing about the file you were sent. For that, the check page publishes the SHA-256 of the original PDF: hash the file you have and compare. A document that has been edited will not match, however convincing it looks.

Key rotation

Rotating keeps the old key in the DID document, so older credentials go on verifying. Revoking withdraws it — a statement that its signatures should no longer be trusted — which is why nothing revokes a key automatically.