import { CRYPTOSUITE_EDDSA_RDFC_2022, PROOF_TYPE_DATA_INTEGRITY } from "./constants.mjs"; //#region src/cryptosuites/EddsaRdfc2022.d.ts interface EddsaRdfc2022KeyPair { id: string; controller: string; publicKeyMultibase: string; privateKeyMultibase?: string; } interface EddsaRdfc2022Proof { type: typeof PROOF_TYPE_DATA_INTEGRITY; cryptosuite: typeof CRYPTOSUITE_EDDSA_RDFC_2022; created: string; verificationMethod: string; proofPurpose: string; proofValue: string; } interface SignOptions { document: Record; keyPair: EddsaRdfc2022KeyPair; purpose?: string; date?: Date | string; challenge?: string; domain?: string; } interface VerifyOptions { document: Record; proof: EddsaRdfc2022Proof; publicKeyMultibase: string; /** * If true, fetch contexts from the network with @protected stripped. * This is needed for verifying external credentials that use full network contexts. */ useNetworkContexts?: boolean; } /** * EdDSA RDFC 2022 Cryptosuite implementation */ declare class EddsaRdfc2022Cryptosuite { static readonly proofType = "DataIntegrityProof"; static readonly cryptosuite = "eddsa-rdfc-2022"; static readonly contextUrl = "https://w3id.org/security/data-integrity/v2"; static readonly verificationMethodTypes: string[]; /** * Sign a document using eddsa-rdfc-2022 cryptosuite */ sign(options: SignOptions): Promise>; /** * Sign a document using an external signer function (e.g., wallet.sign) * This allows integration with KMS-backed keys where private key material is not directly accessible */ signWithSigner(options: { document: Record; verificationMethodId: string; signer: (data: Uint8Array) => Promise; purpose?: string; date?: Date | string; challenge?: string; domain?: string; useNetworkContexts?: boolean; }): Promise>; /** * Verify a document with eddsa-rdfc-2022 proof * * @param options - Verification options including document, proof, public key, and context settings */ verify(options: VerifyOptions): Promise<{ verified: boolean; error?: string; }>; /** * Check if this suite matches a given proof */ matchProof(proof: Record): boolean; /** * Create a document loader for JSON-LD operations * Uses cached contexts for internal operations, preprocessed network contexts for external verification */ private createDocumentLoader; /** * Canonicalize a document using RDFC-1.0 (URDNA2015) * This is the standard algorithm for RDF Dataset Canonicalization. * * @param document - The document to canonicalize * @param useNetworkContexts - If true, fetch contexts from network with @protected stripped */ private canonicalize; /** * Create hash data for signing/verification using RDFC-1.0 algorithm * * Per the spec (https://www.w3.org/TR/vc-di-eddsa/#create-verify-data-eddsa-rdfc-2022): * 1. Canonicalize the document using RDFC-1.0 * 2. Hash the canonical document using SHA-256 * 3. Canonicalize the proof options (without proofValue) * 4. Hash the canonical proof options using SHA-256 * 5. Concatenate: proofOptionsHash || documentHash * * @param document - The document to hash * @param proofOptions - The proof options to hash * @param useNetworkContexts - If true, fetch contexts from network with @protected stripped */ private createHashData; /** * Decode a key pair from multibase format */ private decodeKeyPair; /** * Decode a public key from multibase format */ private decodePublicKey; /** * Generate a new Ed25519 key pair with multibase encoding */ static generateKeyPair(controller: string, keyId?: string): EddsaRdfc2022KeyPair; } //#endregion export { EddsaRdfc2022Cryptosuite, EddsaRdfc2022KeyPair, EddsaRdfc2022Proof, SignOptions, VerifyOptions }; //# sourceMappingURL=EddsaRdfc2022.d.mts.map