import type { Jws, JwsDetachedFormat, JwsGeneralFormat, JwsProtectedHeaderOptions } from './JwsTypes'; import type { Key } from './Key'; import type { Jwk } from './jose/jwk'; import type { AgentContext } from '../agent'; import type { Buffer } from '../utils'; import { JwtPayload } from './jose/jwt'; export declare class JwsService { private createJwsBase; createJws(agentContext: AgentContext, { payload, key, header, protectedHeaderOptions }: CreateJwsOptions): Promise; /** * @see {@link https://www.rfc-editor.org/rfc/rfc7515#section-3.1} * */ createJwsCompact(agentContext: AgentContext, { payload, key, protectedHeaderOptions }: CreateCompactJwsOptions): Promise; /** * Verify a JWS */ verifyJws(agentContext: AgentContext, { jws, jwkResolver }: VerifyJwsOptions): Promise; private buildProtected; private jwkFromJws; } export interface CreateJwsOptions { key: Key; payload: Buffer | JwtPayload; header: Record; protectedHeaderOptions: JwsProtectedHeaderOptions; } type CreateCompactJwsOptions = Omit; export interface VerifyJwsOptions { jws: Jws; jwkResolver?: JwsJwkResolver; } export type JwsJwkResolver = (options: { jws: JwsDetachedFormat; payload: string; protectedHeader: { alg: string; [key: string]: unknown; }; }) => Promise | Jwk; export interface VerifyJwsResult { isValid: boolean; signerKeys: Key[]; } export {};