import { EventComponent } from '@affinidi/affinity-metrics-lib'; import { KeysService, DocumentLoader, KeyManager } from '@affinidi/common'; import { IPlatformCryptographyTools } from '../shared/interfaces'; declare type ConstructorOptions = { registryUrl: string; metricsUrl: string; accessApiKey: string; keysService?: KeysService; keyManager?: KeyManager; }; export default class HolderService { private _didMap; private readonly _affinityService; private readonly _digestService; constructor({ registryUrl, metricsUrl, accessApiKey, keysService, keyManager }: ConstructorOptions, platformCryptographyTools: IPlatformCryptographyTools, component: EventComponent, resolveLegacyElemLocally?: boolean, beforeDocumentLoader?: DocumentLoader); buildCredentialOfferResponse(credentialOfferToken: string): Promise<{ header: { typ: string; alg: string; }; payload: { interactionToken: any; exp: number; typ: string; jti: string; aud: string; }; }>; buildCredentialResponse(credentialRequestToken: string, suppliedCredentials: any, expiresAt?: string): Promise<{ header: { typ: string; alg: string; }; payload: { interactionToken: any; exp: number; typ: string; jti: string; aud: string; }; }>; private _keyIdToDid; private _resolveUniqDIDs; private _resolveDid; private _validateCredentials; verifyCredentialShareResponse(credentialShareResponseToken: string, credentialShareRequestToken?: string, shouldOwn?: boolean): Promise<{ isValid: boolean; did: string; jti: any; suppliedCredentials: any; errors: string[]; }>; /** * @description Slightly modified version of Affinity.validateJWT, * this validates that the given challenge was signed by the expected * issuer and that it isn't exipred. * @param vp - the presentation to be validated * when needed to verify if holder is a subject of VC * @returns { isValid, did, challenge, suppliedPresentations, errors } * * isValid - boolean, result of the verification * * did - DID of the VP issuer (holder of the shared VCs) * * challenge - unique identifier for the presentation. * You are responsible for checking this to protect against replay attacks * * suppliedPresentations - the validated presentation * * errors - array of validation errors */ verifyPresentationChallenge(challenge: string, expectedIssuer: string): Promise; verifyCredentialOfferRequest(credentialOfferRequestToken: string): Promise<{ isValid: boolean; errorCode: string; error: any; }>; } export {};