Credential Verification
Verifying the integrity and authenticity of delegation credentials
Credential Verification
DID Resolution and Key Verification
The foundation of MCP-I verification is resolving DIDs to their corresponding DID Documents.
Resolution Process
- The verifier receives a DID (e.g.,
did:web:example.com
) - The verifier uses the appropriate resolver for the DID method
- The resolver returns a DID Document containing verification methods
- The verifier extracts the public key material needed for signature verification
Key Types Support
MCP-I verification must support these key types:
- Ed25519: Recommended for most implementations
- secp256k1: Required for blockchain compatibility
- RSA: Required for legacy compatibility (Level 1 only)
Resolution Performance
DID resolution can impact verification performance. Consider caching resolved DID documents for frequently encountered DIDs, with appropriate cache invalidation strategies.
Credential Verification
Once DIDs are resolved, the credential itself must be verified through multiple checks.
Signature Verification
The verifier must:
- Extract the verification method from the issuer's DID Document
- Validate the credential's signature using the appropriate algorithm
- Ensure the signature was created by the issuer's key
Example Signature Verification
import { Ed25519Signature2020 } from "@digitalbazaar/ed25519-signature-2020";
import { documentLoader } from "./document-loader.js";
async function verifyCredentialSignature(credential) {
// Create verification suite using the verification method from the credential
const suite = new Ed25519Signature2020();
// Verify the credential signature
const result = await vc.verify({
credential,
suite,
documentLoader,
});
if (!result.verified) {
throw new Error(`Signature verification failed: ${result.error}`);
}
return true;
}
Structural Validation
The verifier must:
- Ensure the credential contains all required fields
- Validate that the credential format follows the MCP-I specification
- Check that the credential type includes the appropriate values
Temporal Validation
The verifier must:
- Check that the credential's
issuanceDate
is in the past - Verify that the current time is before the credential's
expirationDate
- Apply any time-based constraints specified in the credential