From 38586cb703425deb91db32be54a10bb194107357 Mon Sep 17 00:00:00 2001 From: ale-adobe Date: Mon, 3 Aug 2026 17:49:26 -0700 Subject: [PATCH 1/4] Move @contentauth/c2pa-types from devDependencies to dependencies in c2pa-node --- packages/c2pa-node/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/c2pa-node/package.json b/packages/c2pa-node/package.json index f79e84c..8d36259 100644 --- a/packages/c2pa-node/package.json +++ b/packages/c2pa-node/package.json @@ -43,7 +43,6 @@ "license": "MIT", "devDependencies": { "@changesets/cli": "^2.31.0", - "@contentauth/c2pa-types": "workspace:*", "@eslint/js": "^9.39.4", "@neon-rs/cli": "0.1.82", "@types/cli-progress": "^3.11.6", @@ -75,6 +74,7 @@ }, "homepage": "https://github.com/contentauth/c2pa-js/tree/main/packages/c2pa-node#readme", "dependencies": { + "@contentauth/c2pa-types": "workspace:*", "@contentauth/c2pa-utilities": "workspace:*", "cargo-cp-artifact": "^0.1.9", "cli-progress": "^3.12.0", From 5e1a01bca8d577599b2ecabdf97d8e4fbdaf8e2b Mon Sep 17 00:00:00 2001 From: ale-adobe Date: Mon, 3 Aug 2026 17:55:52 -0700 Subject: [PATCH 2/4] Consolidate SigningAlg and ManifestAssertionKind --- .changeset/tame-otters-relax.md | 7 ++++++ packages/c2pa-node/js-src/types.d.ts | 28 ++++++++--------------- packages/c2pa-utilities/package.json | 1 + packages/c2pa-utilities/src/index.ts | 1 + packages/c2pa-utilities/src/signingAlg.ts | 21 +++++++++++++++++ packages/c2pa-utilities/tsconfig.json | 3 +++ packages/c2pa-utilities/tsconfig.lib.json | 5 ++++ packages/c2pa-web/src/lib/signer.ts | 11 +++------ pnpm-lock.yaml | 9 +++++--- 9 files changed, 56 insertions(+), 30 deletions(-) create mode 100644 .changeset/tame-otters-relax.md create mode 100644 packages/c2pa-utilities/src/signingAlg.ts diff --git a/.changeset/tame-otters-relax.md b/.changeset/tame-otters-relax.md new file mode 100644 index 0000000..7c50b5b --- /dev/null +++ b/.changeset/tame-otters-relax.md @@ -0,0 +1,7 @@ +--- +'@contentauth/c2pa-node': patch +'@contentauth/c2pa-web': patch +'@contentauth/c2pa-utilities': minor +--- + +Consolidate the `SigningAlg` type into `@contentauth/c2pa-utilities` (derived from `@contentauth/c2pa-types`'s schema-generated type) instead of hand-duplicating the algorithm list independently in `c2pa-web` and `c2pa-node`, and re-export `c2pa-node`'s `ManifestAssertionKind` from `@contentauth/c2pa-types` instead of a duplicate hand-written copy. Also fix `c2pa-node`'s `package.json` to list `@contentauth/c2pa-types` as a `dependency` rather than a `devDependency`, matching `c2pa-web`. No behavior change. diff --git a/packages/c2pa-node/js-src/types.d.ts b/packages/c2pa-node/js-src/types.d.ts index 76d7eff..64699da 100644 --- a/packages/c2pa-node/js-src/types.d.ts +++ b/packages/c2pa-node/js-src/types.d.ts @@ -19,26 +19,18 @@ import type { C2paReason, Ingredient, Manifest, + ManifestAssertionKind, ManifestStore, } from "@contentauth/c2pa-types"; +import type { SigningAlg } from "@contentauth/c2pa-utilities"; -export type { Action, C2paReason, Ingredient } from "@contentauth/c2pa-types"; - -/** - * Describes the digital signature algorithms allowed by the C2PA spec - * - * Per : - * - * > All digital signatures that are stored in a C2PA Manifest shall > be generated using one of the digital signature algorithms and > key types listed as described in this section - */ -export type SigningAlg = - | "es256" - | "es384" - | "es512" - | "ps256" - | "ps384" - | "ps512" - | "ed25519"; +export type { + Action, + C2paReason, + Ingredient, + ManifestAssertionKind, +} from "@contentauth/c2pa-types"; +export type { SigningAlg } from "@contentauth/c2pa-utilities"; export type ClaimVersion = 1 | 2; @@ -64,8 +56,6 @@ export type TrustmarkVariant = // Quality Trustmark model | "Q"; -export type ManifestAssertionKind = "Cbor" | "Json" | "Binary" | "Uri"; - /** * A buffer for the source asset */ diff --git a/packages/c2pa-utilities/package.json b/packages/c2pa-utilities/package.json index d5212de..9bb70d7 100644 --- a/packages/c2pa-utilities/package.json +++ b/packages/c2pa-utilities/package.json @@ -32,6 +32,7 @@ } }, "dependencies": { + "@contentauth/c2pa-types": "workspace:*", "ts-deepmerge": "^8.0.0" }, "scripts": { diff --git a/packages/c2pa-utilities/src/index.ts b/packages/c2pa-utilities/src/index.ts index 9c50b26..d8c34c1 100644 --- a/packages/c2pa-utilities/src/index.ts +++ b/packages/c2pa-utilities/src/index.ts @@ -10,3 +10,4 @@ export * from './settings.js'; export * from './fetchWithRetry.js'; export * from './caseConversion.js'; +export * from './signingAlg.js'; diff --git a/packages/c2pa-utilities/src/signingAlg.ts b/packages/c2pa-utilities/src/signingAlg.ts new file mode 100644 index 0000000..9e41b29 --- /dev/null +++ b/packages/c2pa-utilities/src/signingAlg.ts @@ -0,0 +1,21 @@ +/** + * Copyright 2026 Adobe + * All Rights Reserved. + * + * NOTICE: Adobe permits you to use, modify, and distribute this file in + * accordance with the terms of the Adobe license agreement accompanying + * it. + */ + +import type { SigningAlg as SchemaSigningAlg } from '@contentauth/c2pa-types'; + +/** + * The digital signature algorithms allowed by the C2PA spec, as accepted/produced by `c2pa-rs` + * at the signer construction boundary (`Signer.alg`, `LocalSigner`/`CallbackSigner` config, etc). + * + * `c2pa-rs` deserializes and displays this value as lowercase here, which is distinct from the + * PascalCase casing it serializes into manifests (see `SigningAlg` from `@contentauth/c2pa-types`, + * used for `SignatureInfo.alg` when reading manifests) — hence this is derived from that schema + * type rather than being identical to it. + */ +export type SigningAlg = Lowercase; diff --git a/packages/c2pa-utilities/tsconfig.json b/packages/c2pa-utilities/tsconfig.json index 62ebbd9..c3670b7 100644 --- a/packages/c2pa-utilities/tsconfig.json +++ b/packages/c2pa-utilities/tsconfig.json @@ -3,6 +3,9 @@ "files": [], "include": [], "references": [ + { + "path": "../c2pa-types" + }, { "path": "./tsconfig.lib.json" }, diff --git a/packages/c2pa-utilities/tsconfig.lib.json b/packages/c2pa-utilities/tsconfig.lib.json index a55f8d3..32ce720 100644 --- a/packages/c2pa-utilities/tsconfig.lib.json +++ b/packages/c2pa-utilities/tsconfig.lib.json @@ -10,6 +10,11 @@ "lib": ["ES2023", "DOM"] }, "include": ["src/**/*.ts"], + "references": [ + { + "path": "../c2pa-types" + } + ], "exclude": [ "vitest.config.ts", "vitest.config.mts", diff --git a/packages/c2pa-web/src/lib/signer.ts b/packages/c2pa-web/src/lib/signer.ts index 865c559..82ab9fc 100644 --- a/packages/c2pa-web/src/lib/signer.ts +++ b/packages/c2pa-web/src/lib/signer.ts @@ -7,14 +7,9 @@ * it. */ -export type SigningAlg = - | 'es256' - | 'es384' - | 'es512' - | 'ps256' - | 'ps384' - | 'ps512' - | 'ed25519'; +import type { SigningAlg } from '@contentauth/c2pa-utilities'; + +export type { SigningAlg }; export interface Signer { sign: ( diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 3968fc6..c958331 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -107,6 +107,9 @@ importers: packages/c2pa-node: dependencies: + '@contentauth/c2pa-types': + specifier: workspace:* + version: link:../c2pa-types '@contentauth/c2pa-utilities': specifier: workspace:* version: link:../c2pa-utilities @@ -141,9 +144,6 @@ importers: '@changesets/cli': specifier: ^2.31.0 version: 2.31.0(@types/node@22.19.20) - '@contentauth/c2pa-types': - specifier: workspace:* - version: link:../c2pa-types '@eslint/js': specifier: ^9.39.4 version: 9.39.4 @@ -225,6 +225,9 @@ importers: packages/c2pa-utilities: dependencies: + '@contentauth/c2pa-types': + specifier: workspace:* + version: link:../c2pa-types ts-deepmerge: specifier: ^8.0.0 version: 8.0.0 From 8220d3ac29a11b0cdc2cfbbf5aa603b6e5f92863 Mon Sep 17 00:00:00 2001 From: ale-adobe Date: Mon, 10 Aug 2026 17:45:22 -0700 Subject: [PATCH 3/4] Update changeset --- .changeset/tame-otters-relax.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.changeset/tame-otters-relax.md b/.changeset/tame-otters-relax.md index 7c50b5b..cafc18d 100644 --- a/.changeset/tame-otters-relax.md +++ b/.changeset/tame-otters-relax.md @@ -4,4 +4,4 @@ '@contentauth/c2pa-utilities': minor --- -Consolidate the `SigningAlg` type into `@contentauth/c2pa-utilities` (derived from `@contentauth/c2pa-types`'s schema-generated type) instead of hand-duplicating the algorithm list independently in `c2pa-web` and `c2pa-node`, and re-export `c2pa-node`'s `ManifestAssertionKind` from `@contentauth/c2pa-types` instead of a duplicate hand-written copy. Also fix `c2pa-node`'s `package.json` to list `@contentauth/c2pa-types` as a `dependency` rather than a `devDependency`, matching `c2pa-web`. No behavior change. +Consolidate the `SigningAlg` type into `@contentauth/c2pa-utilities` (derived from `@contentauth/c2pa-types`'s schema-generated type). Re-use `ManifestAssertionKind` from `@contentauth/c2pa-types` instead of a duplicate hand-written copy. Fix `c2pa-node`'s `package.json` to list `@contentauth/c2pa-types` as a `dependency` rather than a `devDependency`, matching `c2pa-web`. From 2e5c365a0e2fb94871488ecde2b2b37ec042faf9 Mon Sep 17 00:00:00 2001 From: ale-adobe Date: Mon, 10 Aug 2026 17:46:49 -0700 Subject: [PATCH 4/4] Update docs --- packages/c2pa-utilities/src/signingAlg.ts | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/packages/c2pa-utilities/src/signingAlg.ts b/packages/c2pa-utilities/src/signingAlg.ts index 9e41b29..9105dde 100644 --- a/packages/c2pa-utilities/src/signingAlg.ts +++ b/packages/c2pa-utilities/src/signingAlg.ts @@ -10,12 +10,12 @@ import type { SigningAlg as SchemaSigningAlg } from '@contentauth/c2pa-types'; /** - * The digital signature algorithms allowed by the C2PA spec, as accepted/produced by `c2pa-rs` - * at the signer construction boundary (`Signer.alg`, `LocalSigner`/`CallbackSigner` config, etc). + * The digital signature algorithms allowed by the C2PA spec, as accepted/produced by the core + * native library at the signer construction boundary. * - * `c2pa-rs` deserializes and displays this value as lowercase here, which is distinct from the + * The native library deserializes and displays this value as lowercase here, which is distinct from the * PascalCase casing it serializes into manifests (see `SigningAlg` from `@contentauth/c2pa-types`, - * used for `SignatureInfo.alg` when reading manifests) — hence this is derived from that schema + * used for `SignatureInfo.alg` when reading manifests). This is therefore derived from that schema * type rather than being identical to it. */ export type SigningAlg = Lowercase;