Skip to content

Ability to add ingredients without retaining original asset bytes #70

@sorohan

Description

@sorohan

The current ingredient API requires adding an ingredient using the asset bytes, at the time of building the manifest for signing.

We require a workflow where we can read the ingredient ahead of time and store a snapshot to add to the builder later.

The proposed API is to add a new c2pa.ingredient factory:

// Create & persist ingredient
const ref = await c2pa.ingredient.fromBlob(format, blob);
const snapshot = await ref.toSnapshot();
await save(snapshot); // save the snapshot somewhere

// Restore & use
const snapshot = load(); // load the snapshot from somewhere
const ref = await c2pa.ingredient.fromSnapshot(snapshot);
await builder.addIngredient(ref, 'componentOf');

This is pretty consistent with the rust SDK.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions