UNPKG

@credo-ts/core

Version:

<p align="center"> <br /> <img alt="Credo Logo" src="https://github.com/openwallet-foundation/credo-ts/blob/c7886cb8377ceb8ee4efe8d264211e561a75072d/images/credo-logo.png" height="250px" /> </p> <h1 align="center"><b>Credo - Core</b></h1

80 lines • 4.41 kB
import { SdJwtVcHeader } from "../sd-jwt-vc/SdJwtVcOptions.mjs"; import { SdJwtVc } from "../sd-jwt-vc/SdJwtVcService.mjs"; import "../sd-jwt-vc/index.mjs"; import { MdocSessionTranscriptOptions } from "../mdoc/MdocOptions.mjs"; import { MdocDeviceResponse } from "../mdoc/MdocDeviceResponse.mjs"; import "../mdoc/index.mjs"; import { DifPexCredentialsForRequest, DifPexInputDescriptorToCredentials } from "./models/DifPexCredentialsForRequest.mjs"; import { W3cJsonPresentation } from "../vc/models/presentation/W3cJsonPresentation.mjs"; import { W3cJsonLdVerifiablePresentation } from "../vc/linked-data-proofs/models/W3cJsonLdVerifiablePresentation.mjs"; import { W3cJwtVerifiablePresentation } from "../vc/jwt-vc/W3cJwtVerifiablePresentation.mjs"; import { DifPresentationExchangeDefinition, DifPresentationExchangeSubmission, DifPresentationExchangeSubmissionLocation as PresentationSubmissionLocation, VerifiablePresentation } from "./models/index.mjs"; import { W3cCredentialService } from "../vc/W3cCredentialService.mjs"; import "../vc/index.mjs"; import { AgentContext } from "../../agent/context/AgentContext.mjs"; import "../../agent/index.mjs"; //#region src/modules/dif-presentation-exchange/DifPresentationExchangeService.d.ts /** * @todo create a public api for using dif presentation exchange */ export declare class DifPresentationExchangeService { private w3cCredentialService; private pex; constructor(w3cCredentialService: W3cCredentialService); getCredentialsForRequest(agentContext: AgentContext, presentationDefinition: DifPresentationExchangeDefinition): Promise<DifPexCredentialsForRequest>; /** * Selects the credentials to use based on the output from `getCredentialsForRequest` * Use this method if you don't want to manually select the credentials yourself. */ selectCredentialsForRequest(credentialsForRequest: DifPexCredentialsForRequest): DifPexInputDescriptorToCredentials; validatePresentationDefinition(presentationDefinition: DifPresentationExchangeDefinition): void; validatePresentationSubmission(presentationSubmission: DifPresentationExchangeSubmission): void; validatePresentation(presentationDefinition: DifPresentationExchangeDefinition, presentations: VerifiablePresentation | VerifiablePresentation[], presentationSubmission?: DifPresentationExchangeSubmission): void; private formatValidated; createPresentation(agentContext: AgentContext, options: { credentialsForInputDescriptor: DifPexInputDescriptorToCredentials; presentationDefinition: DifPresentationExchangeDefinition; /** * Defaults to {@link DifPresentationExchangeSubmissionLocation.PRESENTATION} */ presentationSubmissionLocation?: PresentationSubmissionLocation; /** * Also known as `nonce` */ challenge: string; /** * Also known as `audience` */ domain?: string; /** * Mdoc openid4vp specific options */ mdocSessionTranscript?: MdocSessionTranscriptOptions; }): Promise<{ verifiablePresentations: (MdocDeviceResponse | W3cJwtVerifiablePresentation | W3cJsonLdVerifiablePresentation | SdJwtVc<SdJwtVcHeader, import("@sd-jwt/sd-jwt-vc").SdJwtVcPayload>)[]; encodedVerifiablePresentations: (string | W3cJsonPresentation)[]; presentationSubmission: import("@sphereon/pex-models").PresentationSubmission; presentationSubmissionLocation: PresentationSubmissionLocation; }>; private getSigningAlgorithmFromVerificationMethod; private getSigningAlgorithmsForPresentationDefinitionAndInputDescriptors; private getSigningAlgorithmForJwtVc; private getProofTypeForLdpVc; /** * if all submission descriptors have a format of di | ldp, * and all credentials have an anoncreds W3C credential proof we default to * signing the presentation using the ANONCREDS_W3C_CREDENTIAL_CRYPTOSUITE */ private shouldSignWithAnonCredsW3cService; private getPresentationSignCallback; private getVerificationMethodForSubjectId; /** * Queries the wallet for credentials that match the given presentation definition. This only does an initial query based on the * schema of the input descriptors. It does not do any further filtering based on the constraints in the input descriptors. */ private queryCredentialForPresentationDefinition; private getSdJwtVcApi; private getMdocApi; } //#endregion //# sourceMappingURL=DifPresentationExchangeService.d.mts.map