@contentauth/c2pa-js
    Preparing search index...
    • Encode a CAWG SignerPayload using c2pa_cbor in this instance's existing worker. Hashes become CBOR byte strings; the wire keys are referenced_assertions, sig_type, and (when nonempty) role. The payload is copied to the worker, so encoding does not detach the caller's hash buffers. Only the instance's worker capability is required; wrappers may replace or omit its reader and builder factories.

      Input names are case-sensitive: referencedAssertions, sigType, roles, and each reference's url, hash, and alg. Wire-format names are not aliases. Missing or incorrectly cased required fields are rejected; unknown data properties are ignored, including incorrectly cased optional fields. Omitted, undefined, or empty roles are omitted on the wire; null roles are rejected.

      Use plain data objects with Uint8Array hashes. The entire payload, including unknown properties, must be structured-cloneable. An unknown function property that Node can ignore still causes a cloning failure here. Validation and cloning failures reject the Promise; Node's validation throws synchronously. Error types and messages are binding-specific.

      Parameters

      Returns Promise<Uint8Array<ArrayBuffer>>