import { Account, Activation, AuthorizationResponse, ClaimsData, Generic, Operator, SigningKey, User, UserPermissionsLimits, ValidDates } from "./types"; import { Key } from "./keys"; import { KeyPair } from "./nkeys"; /** * Enum capturing the JWT algorithm */ export declare enum Algorithms { v1 = "ed25519", v2 = "ed25519-nkey" } export interface UserEncodingOptions extends EncodingOptions { scopedUser?: boolean; } export interface EncodingOptions extends ValidDates { aud?: string; algorithm: Algorithms; signer?: Key; } /** * Generates an operator JWT * @param name - the operator name * @param okp - a key representing the operator * @param operator - operator options * @param opts - encoding options */ export declare function encodeOperator(name: string, okp: Key, operator?: Partial, opts?: Partial): Promise; /** * Generates an account JWT with the specified name having the identity of the * providedd Key. * @param name * @param akp * @param account * @param opts */ export declare function encodeAccount(name: string, akp: Key, account?: Partial, opts?: Partial): Promise; export declare function encodeUser(name: string, ukp: Key, issuer: Key, user?: Partial, opts?: Partial): Promise; export declare function encodeActivation(name: string, subject: Key, issuer: Key, kind: "service" | "stream", data?: Partial, opts?: Partial): Promise; export declare function encodeGeneric(name: string, akp: Key, kind: string, data?: Partial, opts?: Partial): Promise; export declare function encodeAuthorizationResponse(user: Key, server: Key, issuer: Key, data: Partial, opts: Partial): Promise; export declare function decode(jwt: string): ClaimsData; export declare function encode(version: Algorithms, claim: ClaimsData, kp: KeyPair): Promise; export declare function newScopedSigner(signer: Key, role: string, limits: Partial): SigningKey; export declare function fmtCreds(token: string, kp: KeyPair): Uint8Array; export declare function parseCreds(creds: Uint8Array): Promise<{ key: string; jwt: string; uc: ClaimsData; aid: string; }>;