UNPKG

@hellocoop/web-identity

Version:

Functions for generating and verifying JWT tokens used in the Verified Email Autocomplete protocol

27 lines 1.01 kB
import type { JWK } from 'jose'; /** * Validates that a JWK contains required fields for the specified algorithm * @param jwk - JSON Web Key to validate * @returns void (throws on validation failure) */ export declare function validateJWK(jwk: JWK): void; /** * Extracts only the public key parameters from a JWK for inclusion in cnf claims * Removes private key material (d parameter) and other sensitive information * @param jwk - Source JWK (may contain private key) * @returns JWK with only public key parameters */ export declare function extractPublicKeyParameters(jwk: JWK): JWK; /** * Calculates SHA-256 hash of a string * @param input - String to hash * @returns Base64url-encoded hash */ export declare function calculateSHA256Hash(input: string): string; /** * Validates email address syntax * @param email - Email address to validate * @returns true if valid, false otherwise */ export declare function isValidEmail(email: string): boolean; //# sourceMappingURL=crypto.d.ts.map