hashbasedtoken
Version:
21 lines • 971 B
TypeScript
type Algorithm = 'HS256' | 'HS384' | 'HS512' | 'RS256' | 'RS384' | 'RS512' | 'PS256' | 'PS384' | 'PS512' | 'ES256' | 'ES384' | 'ES512' | 'none';
export type HbtOptions = {
algorithm?: Algorithm;
};
export type HbtSignOptions = HbtOptions & {
expiresIn?: string | number;
};
export declare function sign(id: string | number, secretOrPublicKey: string, options?: HbtSignOptions): Promise<string>;
export declare function verify(token: string, secretOrPublicKey: string, options?: HbtOptions): Promise<boolean>;
export declare function getTokenId(token: string): string;
export declare function getTokenExpires(token: string): number;
export declare function isExpires(token: string): boolean;
declare const _default: {
sign: typeof sign;
verify: typeof verify;
getTokenId: typeof getTokenId;
getTokenExpires: typeof getTokenExpires;
isExpires: typeof isExpires;
};
export default _default;
//# sourceMappingURL=index.d.ts.map