UNPKG

@sphereon/did-auth-siop

Version:

Self Issued OpenID V2 (SIOPv2) and OpenID 4 Verifiable Presentations (OID4VP)

27 lines 1.05 kB
import { JWK } from '../types'; export type Jwks = { keys: JWK[]; }; export type JwksMetadataParams = { jwks?: Jwks; jwks_uri?: string; }; /** * Fetches a JSON Web Key Set (JWKS) from the specified URI. * * @param jwksUri - The URI of the JWKS endpoint. * @returns A Promise that resolves to the JWKS object. * @throws Will throw an error if the fetch fails or if the response is not valid JSON. */ export declare function fetchJwks(jwksUri: string): Promise<Jwks | undefined>; /** * Extracts JSON Web Key Set (JWKS) from the provided metadata. * If a jwks field is provided, the JWKS will be extracted from the field. * If a jwks_uri is provided, the JWKS will be fetched from the URI. * * @returns A promise that resolves to the extracted JWKS or undefined. * @throws {JoseJwksExtractionError} If the metadata format is invalid or no decryption key is found. * @param metadata */ export declare const extractJwksFromJwksMetadata: (metadata: JwksMetadataParams) => Promise<Jwks>; //# sourceMappingURL=ExtractJwks.d.ts.map