@aspect-evp/core
v0.1.1
Published
Shared types and utilities for the Email Verification Protocol
Maintainers
Readme
@aspect-evp/core
Shared types, constants, and utilities for the Email Verification Protocol.
Installation
npm install @aspect-evp/coreUsage
import {
EVPError,
parseSDJWTKB,
sha256,
getEmailDomain,
SD_JWT_TYPE,
KB_JWT_TYPE,
} from '@aspect-evp/core';
// Parse SD-JWT+KB token
const { sdJwt, kbJwt, sdJwtForHash } = parseSDJWTKB(token);
// Get email domain
const domain = getEmailDomain('[email protected]'); // 'gmail.com'
// Hash for sd_hash claim
const hash = await sha256(sdJwt);Testing Utilities
import { createTestFlow, MockDnsResolver } from '@aspect-evp/core/testing';
// Create test fixtures
const testFlow = await createTestFlow({
issuer: 'issuer.example.com',
rpOrigin: 'https://myapp.example.com',
});
// Create tokens for testing
const token = await testFlow.createToken('[email protected]', 'nonce');Documentation
See the full documentation for complete API reference.
License
MIT
