import { type Jwk, type KeyUsage, type PrivateJwk, type PublicJwk } from './jwk.js'; import type { VerifyOptions, VerifyResult } from './jwt-verify.js'; import type { JwtHeader, JwtPayload, SignedJwt } from './jwt.js'; export type KeyMatchOptions = { usage?: KeyUsage; kid?: string | string[]; alg?: string | string[]; }; export type ActivityCheckOptions = { allowRevoked?: boolean; clockTolerance?: number; currentDate?: Date; }; export declare abstract class Key { readonly jwk: Readonly; constructor(jwk: Readonly); get isPrivate(): boolean; get isSymetric(): boolean; get privateJwk(): Readonly | undefined; get publicJwk(): Readonly | undefined; get bareJwk(): Readonly | undefined; /** * @note Only defined on public keys */ get use(): 'sig' | 'enc' | undefined; get keyOps(): readonly KeyUsage[] | undefined; /** * The (forced) algorithm to use. If not provided, the key will be usable with * any of the algorithms in {@link algorithms}. * * @see {@link https://datatracker.ietf.org/doc/html/rfc7518#section-3.1 | "alg" (Algorithm) Header Parameter Values for JWS} */ get alg(): J["alg"] | undefined; get kid(): J["kid"] | undefined; get crv(): "Ed25519" | "Ed448" | "P-256" | "P-384" | "P-521" | "secp256k1" | undefined; /** * All the algorithms that this key can be used with. If `alg` is provided, * this set will only contain that algorithm. */ get algorithms(): readonly string[]; get isRevoked(): boolean; isActive(options?: ActivityCheckOptions): boolean; matches(opts: KeyMatchOptions): boolean; /** * Create a signed JWT */ abstract createJwt(header: JwtHeader, payload: JwtPayload): Promise; /** * Verify the signature, headers and payload of a JWT * * @throws {JwtVerifyError} if the JWT is invalid */ abstract verifyJwt(token: SignedJwt, options?: VerifyOptions): Promise>; } //# sourceMappingURL=key.d.ts.map