///
import * as jose from 'node-jose';
export interface JWKS {
keys: T[];
}
export interface PublicJWK {
kty: string;
kid: string;
use: KeyUse;
alg: string;
e: string;
n: string;
}
export interface PrivateJWK extends PublicJWK {
d: string;
p: string;
q: string;
dp: string;
dq: string;
qi: string;
}
export type JWKMetadata = Pick;
export type KeyUse = 'enc' | 'desc';
export type PublicJWKS = JWKS;
export type PrivateJWKS = JWKS;
export type JWK = PrivateJWK | PublicJWK;
export type UnsignedJWK = PrivateJWK | PublicJWK;
export declare const RSA_ALGORITHM = "RSA-OAEP";
export interface JWKDecryptResult extends Omit {
/**
* JWK metadata
*/
key: JWKMetadata;
/**
* an object of "protected" member key values.
*/
header: Record;
/**
* payload Buffer
*/
payload: Buffer;
}
export declare class JWKSManager {
store: any;
JWK: typeof jose.JWK;
JWE: typeof jose.JWE;
constructor(store: any, jwk?: typeof jose.JWK, jwe?: typeof jose.JWE);
addKey(kid: string | undefined, modulus: number, use: KeyUse): Promise;
insertKey(jwk: jose.JWK.Key): Promise;
getPublicJWK(kid?: string): PublicJWK | null;
getPrivateJWK(kid?: string): PrivateJWK | null;
getPublicJWKS(): PublicJWKS;
getPrivateJWKS(): PrivateJWKS;
removeKey(key: PublicJWK | PrivateJWK): void;
encrypt(kid: string, input: Buffer): Promise;
decrypt(payload: any, jwks?: any): Promise;
protected getKey(kid?: string): any;
}
export declare function createJWKS(jwk: typeof jose.JWK, jwks?: JWKS): Promise;
export declare function createJWKSManager(jwks?: JWKS): Promise;