import { PresentationDefinition, PresentationSubmission } from '@sphereon/pe-models'; import { EvaluationResults } from '../evaluation'; import { Presentation, Proof, VerifiableCredential } from '../types'; import { ProofPurpose, ProofType } from '../types/SSI.types'; export interface ProofOptions { /** * The signature type. For instance RsaSignature2018 */ type?: ProofType | string; /** * Type supports selective disclosure? */ typeSupportsSelectiveDisclosure?: boolean; /** * A challenge protecting against replay attacks */ challenge?: string; /** * A domain protecting against replay attacks */ domain?: string; /** * The purpose of this proof, for instance assertionMethod or authentication, see https://www.w3.org/TR/vc-data-model/#proofs-signatures-0 */ proofPurpose?: ProofPurpose | string; /** * The ISO8601 date-time string for creation. You can update the Proof value later in the callback. If not supplied the current date/time will be used */ created?: string; /** * Similar to challenge. A nonce to protect against replay attacks, used in some ZKP proofs */ nonce?: string; } export interface SignatureOptions { /** * The private key */ privateKey?: string; /** * Key encoding */ keyEncoding?: KeyEncoding; /** * The verification method value */ verificationMethod?: string; /** * Can be used if you want to provide the Json-ld proof value directly without relying on the callback function generating it */ proofValue?: string; /** * Can be used if you want to provide the JSW proof value directly without relying on the callback function generating it */ jws?: string; } export interface PresentationSignOptions { /** * The optional holder of the presentation */ holder?: string; /** * Proof options */ proofOptions?: ProofOptions; /** * The signature options */ signatureOptions?: SignatureOptions; } export interface PresentationSignCallBackParams { /** * The originally supplied presentation sign options */ options: PresentationSignOptions; /** * The presentation definition */ presentationDefinition: PresentationDefinition; /** * The selected credentials to include in the eventual VP as determined by PE-JS and/or user */ selectedCredentials: VerifiableCredential[]; /** * The presentation object created from the definition and verifiable credentials. * Can be used directly or in more complex situations can be discarded by using the definition, credentials, proof options, submission and evaluation results */ presentation: Presentation; /** * A partial proof value the callback can use to complete. If proofValue or JWS was supplied the proof could be complete already */ proof: Partial; /** * The presentation submission data, which can also be found in the presentation itself */ presentationSubmission: PresentationSubmission; /** * The evaluation results, which the callback function could use to create a VP using the proof(s) using the supplied credentials */ evaluationResults: EvaluationResults; } export declare enum KeyEncoding { Jwk = "Jwk", Base58 = "Base58", Hex = "Hex", Multibase = "Multibase" }