@joinmonolith/c2pa-node
    Preparing search index...

    Class Builder

    Implements

    Index

    Constructors

    Methods

    • Add a single action to the manifest. This is a convenience method for adding an action to the Actions assertion.

      Parameters

      • actionJson: string

        The JSON representation of the action

      Returns void

    • Add an ingredient to the manifest

      Parameters

      • ingredientJson: string

        The JSON representation of the ingredient

      • Optionalingredient: SourceAsset

        Optional source asset (buffer or file) for the ingredient

      Returns Promise<void>

    • Redact an assertion from an ingredient manifest and record the reason. Adds the URI to definition.redactions and appends a c2pa.redacted action with parameters.redacted pointing to the same URI.

      Parameters

      • uri: string

        JUMBF URI of the assertion to redact (e.g. self#jumbf=/c2pa/{label}/c2pa.assertions/{name})

      • reason: string

        Why the assertion is being redacted. Use "c2pa.PII.present" for PII removal.

      Returns void

    • An intent lets the API know what kind of manifest to create. Intents are Create, Edit, or Update. This allows the API to check that you are doing the right thing. It can also do things for you, like add parent ingredients from the source asset and automatically add required c2pa.created or c2pa.opened actions. Create requires a DigitalSourceType. It is used for assets without a parent ingredient. Edit requires a parent ingredient and is used for most assets that are being edited. Update is a special case with many restrictions but is more compact than Edit.

      Parameters

      • intent: BuilderIntent

        The intent of the manifest

      Returns void

    • Produce a signed embeddable manifest from a pre-computed DataHash.

      Unlike sign, this does not require the asset bytes at sign time — the caller has already computed the hash externally. The returned manifest binary can be embedded by the caller, or shipped as a sidecar / referenced via a remote-manifest URL.

      Typical use: sidecar / remote-manifest signing where only the SHA-256 digest of the asset is available. With exclusions: [] and alg: "sha256", c2pa.hash.data.hash in the resulting manifest equals SHA-256(asset), which a verifier can recompute from the original file.

      Parameters

      • signer: LocalSignerInterface

        The local signer

      • dataHash: DataHash

        The pre-computed data hash

      • format: string

        MIME type of the target asset (e.g. "image/jpeg")

      Returns Buffer

      The signed c2pa_manifest bytes (preformatted for format)