@binlebin/c2pa-ssl
Version:
Node.js wrapper for C2PA content authentication using Rust CLI backend
49 lines (41 loc) • 1.14 kB
TypeScript
/**
* TypeScript declarations for @binlebin/c2pa-ssl
*
* Node.js wrapper for C2PA CLI tool with OpenSSL backend
* for content authentication. No longer manages HTTP services.
*/
export interface C2PASignResult {
success: boolean;
message: string;
stdout: string;
stderr: string;
}
export interface C2PAMetadata {
title?: string;
description?: string;
author?: string;
}
export declare class C2PAService {
constructor();
/**
* Path to the CLI binary
*/
readonly binaryPath: string;
/**
* Initialize the service by setting up certificates
* Must be called before signing files
*/
start(): Promise<void>;
/**
* Clean up temporary files and certificates
*/
stop(): Promise<void>;
/**
* Sign a file with C2PA authentication
* @param inputPath Path to input file
* @param outputPath Path where signed file will be saved
* @param metadata Optional metadata for the signed content
*/
signFile(inputPath: string, outputPath: string, metadata?: C2PAMetadata): Promise<C2PASignResult>;
}
export = C2PAService;