import { JWTObject } from './jwt'; import { DidDocument } from './identity'; import { VPData, SIOPTokensEcoded } from './claims'; import { DidResolver } from './identity/resolvers/did-resolver-base'; export declare const ERRORS: Readonly<{ NO_SIGNING_INFO: "At least one public key must be confirmed with related private key"; UNRESOLVED_IDENTITY: "Unresolved identity"; NO_PUBLIC_KEY: "No public key matches given private key"; }>; /** * @classdesc This class provides the functionality of a DID based Self Issued OpenID Connect Provider * @property {Identity} identity - Used to store Decentralized Identity information of the Provider (end user) * @property {SigningInfo[]} signing_info_set - Used to store a list of cryptographic information used to sign id_tokens */ export declare class Provider { private identity; private signing_info_set; private resolvers; private constructor(); /** * @param {string} did - The DID of the provider (end user) * @param {DidDocument} [doc] - DID Document of the provider (end user). * @param {DidResolver[]} [resolvers] - Array of Resolvers (Derived from DidResolver) to be used for DID resolution * @remarks This method is used to set the decentralized identity for the provider (end user). * doc parameter is optional and if provided it will be used to directly set the identity. * Otherwise the DID Document will be resolved over a related network. */ static getProvider(did: string, doc?: DidDocument, resolvers?: DidResolver[]): Promise; /** * @param {string} did - The DID of the provider (end user) * @param {DidDocument} [doc] - DID Document of the provider (end user). * @remarks This method is used to set the decentralized identity for the provider (end user). * doc parameter is optional and if provided it will be used to directly set the identity. * Otherwise the DID Document will be resolved over a related network. */ setUser(did: string, doc?: DidDocument, resolvers?: DidResolver[]): Promise; /** * @param {string} key - Private part of any cryptographic key listed in the 'authentication' field of the user's DID Document * @returns {string} - kid of the added key * @remarks This method is used to add signing information to 'signing_info_set'. * Given key is iteratively tried with * every public key listed in the 'authentication' field of RP's DID Document and every key format * until a compatible combination of those information which can be used for the signing process is found. */ addSigningParams(key: string): string; /** * @param {string} kid - kid value of the SigningInfo which needs to be removed from the list * @remarks This method is used to remove a certain SigningInfo (key) which has the given kid value from the list. */ removeSigningParams(kid: string): void; /** * @param {string} request - A DID SIOP request * @param {any} op_metadata - SIOP(OpenIdConnect Provider) metadata: refer core/globals/SIOP_METADATA_SUPPORTED * https://openid.net/specs/openid-connect-self-issued-v2-1_0.html#name-static-self-issued-openid-p * @param {DidResolver[]} [resolvers] - Array of Resolvers (Derived from DidResolver) to be used for DID resolution * @returns {Promise} - A Promise which resolves to a decoded request JWT * @remarks This method is used to validate requests coming from Relying Parties. */ validateRequest(request: string, op_metadata?: any, resolvers?: DidResolver[]): Promise; /** * @param {any} requestPayload - Payload of the request JWT for which a response needs to be generated * @param {number} expiresIn - Number of miliseconds under which the generated response is valid. Relying Parties can * either consider this value or ignore it * @returns {Promise} - A Promise which resolves to an encoded DID SIOP response JWT * @remarks This method is used to generate a response to a given DID SIOP request. */ generateResponse(requestPayload: any, expiresIn?: number): Promise; /** * @param {any} requestPayload - Payload of the request JWT for which a response needs to be generated * @param {number} expiresIn - Number of miliseconds under which the generated response is valid. Relying Parties can * either consider this value or ignore it * @param {vps} VPData - This contains the data for vp_token and additional info to send via id_token (_vp_token) * @returns {Promise} - A Promise which resolves to a SIOPTokensEcoded * @remarks This method is used to generate a response to a given DID SIOP request which includes VP Data. */ generateResponseWithVPData(requestPayload: any, expiresIn: number | undefined, vps: VPData): Promise; /** * @param {string} errorMessage - Message of a specific SIOPErrorResponse * @returns {string} - Encoded SIOPErrorResponse object * @remarks This method is used to generate error responses. */ generateErrorResponse(errorMessage: string): string; }