import type { IJsonLdNodeObject } from "@twin.org/data-json-ld"; import type { IJwk } from "@twin.org/web"; import type { IProof } from "../models/IProof.js"; import type { IProofSignerVerifier } from "../models/IProofSignerVerifier.js"; import type { IProofSignerVerifierAsync } from "../models/IProofSignerVerifierAsync.js"; import { ProofTypes } from "../models/proofTypes.js"; /** * Helper methods for creating and verifying proofs. */ export declare class ProofHelper { /** * Runtime name for the class. */ static readonly CLASS_NAME: string; /** * Create a signer verifier. * @param proofType The type of proof to create. * @returns The created signer verifier. * @throws GeneralError if the proof type is not supported. */ static createSignerVerifier(proofType: ProofTypes): IProofSignerVerifier; /** * Create an async signer verifier that supports signing with callbacks. * This enables signing without exposing private keys. * @param proofType The type of proof to create. * @returns The created async signer verifier. * @throws GeneralError if the proof type is not supported. */ static createAsyncSignerVerifier(proofType: ProofTypes): IProofSignerVerifierAsync; /** * Create a proof for the given data. * @param proofType The type of proof to create. * @param unsecuredDocument The data to create the proof for. * @param unsignedProof The proof options. * @param signKey The key to sign the proof with. * @returns The created proof. */ static createProof(proofType: ProofTypes, unsecuredDocument: IJsonLdNodeObject, unsignedProof: IProof, signKey: IJwk): Promise; /** * Create a proof with an async signing callback. * This method prevents private key exposure by delegating signing to a secure callback. * @param proofType The type of proof to create. * @param unsecuredDocument The data to create the proof for. * @param unsignedProof The proof options. * @param signCallback Async callback that signs data with a private key from secure storage. The algorithm parameter indicates the expected signing algorithm (e.g., "EdDSA") to enable validation. * @returns The created proof. */ static createProofWithSigner(proofType: ProofTypes, unsecuredDocument: IJsonLdNodeObject, unsignedProof: IProof, signCallback: (data: Uint8Array, algorithm: string) => Promise): Promise; /** * Verify a proof for the given data. * @param securedDocument The credential to verify. * @param signedProof The proof to verify. * @param verifyKey The public key to verify the proof with. * @returns True if the credential was verified. */ static verifyProof(securedDocument: IJsonLdNodeObject, signedProof: IProof, verifyKey: IJwk): Promise; /** * Create an unsigned proof. * @param proofType The type of proof to create. * @param verificationMethodId The verification method id. * @param otherParams Other parameters for the proof. * @returns The created proof. * @throws GeneralError if the proof type is not supported. */ static createUnsignedProof(proofType: ProofTypes, verificationMethodId: string, otherParams?: any): IProof; }