@e-sig/core 0.6.0 → 0.7.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (85) hide show
  1. package/LICENSE +1 -1
  2. package/dist/index.d.ts +3 -3
  3. package/dist/index.d.ts.map +1 -1
  4. package/dist/index.js +2 -2
  5. package/dist/index.js.map +1 -1
  6. package/dist/pem-signer.d.ts +26 -5
  7. package/dist/pem-signer.d.ts.map +1 -1
  8. package/dist/pem-signer.js +84 -13
  9. package/dist/pem-signer.js.map +1 -1
  10. package/dist/pq-seal.d.ts +53 -3
  11. package/dist/pq-seal.d.ts.map +1 -1
  12. package/dist/pq-seal.js +92 -8
  13. package/dist/pq-seal.js.map +1 -1
  14. package/dist/pq-verify.d.ts +22 -0
  15. package/dist/pq-verify.d.ts.map +1 -1
  16. package/dist/pq-verify.js +16 -0
  17. package/dist/pq-verify.js.map +1 -1
  18. package/dist/render-pdf.d.ts +5 -5
  19. package/dist/render-pdf.d.ts.map +1 -1
  20. package/dist/render-pdf.js +51 -17
  21. package/dist/render-pdf.js.map +1 -1
  22. package/dist/sign-pdf.d.ts +45 -4
  23. package/dist/sign-pdf.d.ts.map +1 -1
  24. package/dist/sign-pdf.js +24 -1
  25. package/dist/sign-pdf.js.map +1 -1
  26. package/dist/types.d.ts +36 -0
  27. package/dist/types.d.ts.map +1 -1
  28. package/dist/vendor/placeholder-plain/LICENSE-signpdf.md +47 -0
  29. package/dist/vendor/placeholder-plain/createBufferPageWithAnnotation.d.ts +6 -0
  30. package/dist/vendor/placeholder-plain/createBufferPageWithAnnotation.d.ts.map +1 -0
  31. package/dist/vendor/placeholder-plain/createBufferPageWithAnnotation.js +38 -0
  32. package/dist/vendor/placeholder-plain/createBufferPageWithAnnotation.js.map +1 -0
  33. package/dist/vendor/placeholder-plain/createBufferRootWithAcroform.d.ts +6 -0
  34. package/dist/vendor/placeholder-plain/createBufferRootWithAcroform.d.ts.map +1 -0
  35. package/dist/vendor/placeholder-plain/createBufferRootWithAcroform.js +15 -0
  36. package/dist/vendor/placeholder-plain/createBufferRootWithAcroform.js.map +1 -0
  37. package/dist/vendor/placeholder-plain/createBufferTrailer.d.ts +4 -0
  38. package/dist/vendor/placeholder-plain/createBufferTrailer.d.ts.map +1 -0
  39. package/dist/vendor/placeholder-plain/createBufferTrailer.js +26 -0
  40. package/dist/vendor/placeholder-plain/createBufferTrailer.js.map +1 -0
  41. package/dist/vendor/placeholder-plain/findObject.d.ts +4 -0
  42. package/dist/vendor/placeholder-plain/findObject.d.ts.map +1 -0
  43. package/dist/vendor/placeholder-plain/findObject.js +18 -0
  44. package/dist/vendor/placeholder-plain/findObject.js.map +1 -0
  45. package/dist/vendor/placeholder-plain/getIndexFromRef.d.ts +4 -0
  46. package/dist/vendor/placeholder-plain/getIndexFromRef.d.ts.map +1 -0
  47. package/dist/vendor/placeholder-plain/getIndexFromRef.js +13 -0
  48. package/dist/vendor/placeholder-plain/getIndexFromRef.js.map +1 -0
  49. package/dist/vendor/placeholder-plain/getPageRef.d.ts +6 -0
  50. package/dist/vendor/placeholder-plain/getPageRef.d.ts.map +1 -0
  51. package/dist/vendor/placeholder-plain/getPageRef.js +18 -0
  52. package/dist/vendor/placeholder-plain/getPageRef.js.map +1 -0
  53. package/dist/vendor/placeholder-plain/getPagesDictionaryRef.d.ts +3 -0
  54. package/dist/vendor/placeholder-plain/getPagesDictionaryRef.d.ts.map +1 -0
  55. package/dist/vendor/placeholder-plain/getPagesDictionaryRef.js +12 -0
  56. package/dist/vendor/placeholder-plain/getPagesDictionaryRef.js.map +1 -0
  57. package/dist/vendor/placeholder-plain/index.d.ts +2 -0
  58. package/dist/vendor/placeholder-plain/index.d.ts.map +1 -0
  59. package/dist/vendor/placeholder-plain/index.js +4 -0
  60. package/dist/vendor/placeholder-plain/index.js.map +1 -0
  61. package/dist/vendor/placeholder-plain/pdfObject.d.ts +13 -0
  62. package/dist/vendor/placeholder-plain/pdfObject.d.ts.map +1 -0
  63. package/dist/vendor/placeholder-plain/pdfObject.js +142 -0
  64. package/dist/vendor/placeholder-plain/pdfObject.js.map +1 -0
  65. package/dist/vendor/placeholder-plain/pdfkitAddPlaceholder.d.ts +49 -0
  66. package/dist/vendor/placeholder-plain/pdfkitAddPlaceholder.d.ts.map +1 -0
  67. package/dist/vendor/placeholder-plain/pdfkitAddPlaceholder.js +115 -0
  68. package/dist/vendor/placeholder-plain/pdfkitAddPlaceholder.js.map +1 -0
  69. package/dist/vendor/placeholder-plain/plainAddPlaceholder.d.ts +41 -0
  70. package/dist/vendor/placeholder-plain/plainAddPlaceholder.d.ts.map +1 -0
  71. package/dist/vendor/placeholder-plain/plainAddPlaceholder.js +95 -0
  72. package/dist/vendor/placeholder-plain/plainAddPlaceholder.js.map +1 -0
  73. package/dist/vendor/placeholder-plain/readPdf.d.ts +20 -0
  74. package/dist/vendor/placeholder-plain/readPdf.d.ts.map +1 -0
  75. package/dist/vendor/placeholder-plain/readPdf.js +47 -0
  76. package/dist/vendor/placeholder-plain/readPdf.js.map +1 -0
  77. package/dist/vendor/placeholder-plain/readRefTable.d.ts +17 -0
  78. package/dist/vendor/placeholder-plain/readRefTable.d.ts.map +1 -0
  79. package/dist/vendor/placeholder-plain/readRefTable.js +84 -0
  80. package/dist/vendor/placeholder-plain/readRefTable.js.map +1 -0
  81. package/dist/vendor/placeholder-plain/xrefToRefMap.d.ts +3 -0
  82. package/dist/vendor/placeholder-plain/xrefToRefMap.d.ts.map +1 -0
  83. package/dist/vendor/placeholder-plain/xrefToRefMap.js +38 -0
  84. package/dist/vendor/placeholder-plain/xrefToRefMap.js.map +1 -0
  85. package/package.json +4 -5
package/LICENSE CHANGED
@@ -1,6 +1,6 @@
1
1
  MIT License
2
2
 
3
- Copyright (c) 2026 Opendelphi contributors
3
+ Copyright (c) 2026 VMVTech, Ltd.
4
4
 
5
5
  Permission is hereby granted, free of charge, to any person obtaining a copy
6
6
  of this software and associated documentation files (the "Software"), to deal
package/dist/index.d.ts CHANGED
@@ -1,15 +1,15 @@
1
1
  export { PemSigner, type PemSignerInput } from "./pem-signer.js";
2
2
  export { generateSelfSignedCert, encryptKeyPem, decryptKeyPem, type GenerateCertOptions, type GeneratedCert, } from "./cert-issuer.js";
3
3
  export { renderHtmlToPdf, type RenderHtmlToPdfOptions } from "./render-pdf.js";
4
- export { signPdf, type SignPdfInput, type SignPdfResult } from "./sign-pdf.js";
4
+ export { signPdf, SUPPORTED_SUBFILTERS, type SubFilter, type SignPdfInput, type SignPdfResult, } from "./sign-pdf.js";
5
5
  export { verifyPdfStructure, verifyPdfSignature, type VerifyResult } from "./verify-pdf.js";
6
6
  export { buildTimeStampReq, parseTimeStampResp, parseTstInfo, OID_TIMESTAMP_TOKEN, } from "./timestamp.js";
7
- export type { Signer, SigningCertPem, SignedPdfMetadata, TsaTransport, } from "./types.js";
7
+ export type { Signer, SigningCertPem, SignedPdfMetadata, TsaTransport, ExternalSigner, ExternalSignerKeyType, } from "./types.js";
8
8
  export type { StoredCert, CertStore, AuditLogEntry, AuditLogRow, AuditLogStore, EsigAuditAction, PdfStorageStore, } from "./adapters.js";
9
9
  export { ensureActiveCert, type EnsureCertResult } from "./cert-lifecycle.js";
10
10
  export { createEnvelope, resolveSigningToken, recordSignature, declineEnvelope, voidEnvelope, composeEnvelopeHtml, EnvelopeError, type Envelope, type EnvelopeSigner, type EnvelopeStatus, type EnvelopeSignerStatus, type EnvelopeStore, type CreateEnvelopeInput, type CreateEnvelopeResult, type TokenResolution, } from "./envelope.js";
11
11
  export { signDocument, type SignDocumentInput, type SignDocumentResult, } from "./sign-document.js";
12
- export { generatePqKeyBundle, loadPqSigningKeys, publicMaterialForKeys, wrapPqKeyBundle, unwrapPqKeyBundle, buildPqSeal, verifyPqSealSignatures, canonicalJson, PQ_SEAL_VERSION, PQ_SEAL_ALG, type PqKeyBundle, type PqPublicMaterial, type PqSigningKeys, type PqSeal, type PqSealVerification, type BuildPqSealInput, } from "./pq-seal.js";
12
+ export { generatePqKeyBundle, loadPqSigningKeys, publicMaterialForKeys, wrapPqKeyBundle, unwrapPqKeyBundle, buildPqSeal, verifyPqSealSignatures, isWellFormedUuaidAssertion, canonicalJson, PQ_SEAL_VERSION, PQ_SEAL_ALG, type GeneratePqKeyBundleOptions, type PqKeyBundle, type PqPublicMaterial, type PqSigningKeys, type PqSeal, type PqSealVerification, type BuildPqSealInput, } from "./pq-seal.js";
13
13
  export { embedPqSeal, extractPqSeal, hasPqSeal } from "./pq-embed.js";
14
14
  export { verifyPqSeal, verifyDocument, type PqSealVerdict, type DocumentVerification, type VerifyPqSealOptions, type VerifyDocumentOptions, } from "./pq-verify.js";
15
15
  export { ensureActivePqKeys, rotatePqKeys, type PqKeyStore, type StoredPqKeys, type EnsurePqKeysResult, } from "./pq-lifecycle.js";
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAWA,OAAO,EAAE,SAAS,EAAE,KAAK,cAAc,EAAE,MAAM,iBAAiB,CAAC;AACjE,OAAO,EACL,sBAAsB,EACtB,aAAa,EACb,aAAa,EACb,KAAK,mBAAmB,EACxB,KAAK,aAAa,GACnB,MAAM,kBAAkB,CAAC;AAC1B,OAAO,EAAE,eAAe,EAAE,KAAK,sBAAsB,EAAE,MAAM,iBAAiB,CAAC;AAC/E,OAAO,EAAE,OAAO,EAAE,KAAK,YAAY,EAAE,KAAK,aAAa,EAAE,MAAM,eAAe,CAAC;AAC/E,OAAO,EAAE,kBAAkB,EAAE,kBAAkB,EAAE,KAAK,YAAY,EAAE,MAAM,iBAAiB,CAAC;AAC5F,OAAO,EACL,iBAAiB,EACjB,kBAAkB,EAClB,YAAY,EACZ,mBAAmB,GACpB,MAAM,gBAAgB,CAAC;AACxB,YAAY,EACV,MAAM,EACN,cAAc,EACd,iBAAiB,EACjB,YAAY,GACb,MAAM,YAAY,CAAC;AAGpB,YAAY,EACV,UAAU,EACV,SAAS,EACT,aAAa,EACb,WAAW,EACX,aAAa,EAC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GvB,OAAO,EACL,YAAY,EACZ,KAAK,iBAAiB,EACtB,KAAK,kBAAkB,GACxB,MAAM,oBAAoB,CAAC;AAG5B,OAAO,EACL,mBAAmB,EACnB,iBAAiB,EACjB,qBAAqB,EACrB,eAAe,EACf,iBAAiB,EACjB,WAAW,EACX,sBAAsB,EACtB,0BAA0B,EAC1B,aAAa,EACb,eAAe,EACf,WAAW,EACX,KAAK,0BAA0B,EAC/B,KAAK,WAAW,EAChB,KAAK,gBAAgB,EACrB,KAAK,aAAa,EAClB,KAAK,MAAM,EACX,KAAK,kBAAkB,EACvB,KAAK,gBAAgB,GACtB,MAAM,cAAc,CAAC;AACtB,OAAO,EAAE,WAAW,EAAE,aAAa,EAAE,SAAS,EAAE,MAAM,eAAe,CAAC;AACtE,OAAO,EACL,YAAY,EACZ,cAAc,EACd,KAAK,aAAa,EAClB,KAAK,oBAAoB,EACzB,KAAK,mBAAmB,EACxB,KAAK,qBAAqB,GAC3B,MAAM,gBAAgB,CAAC;AACxB,OAAO,EACL,kBAAkB,EAClB,YAAY,EACZ,KAAK,UAAU,EACf,KAAK,YAAY,EACjB,KAAK,kBAAkB,GACxB,MAAM,mBAAmB,CAAC;AAC3B,OAAO,EACL,qBAAqB,EACrB,qBAAqB,EACrB,sBAAsB,EACtB,iBAAiB,EACjB,YAAY,EACZ,KAAK,qBAAqB,EAC1B,KAAK,gBAAgB,EACrB,KAAK,sBAAsB,EAC3B,KAAK,gBAAgB,GACtB,MAAM,cAAc,CAAC"}
package/dist/index.js CHANGED
@@ -11,7 +11,7 @@
11
11
  export { PemSigner } from "./pem-signer.js";
12
12
  export { generateSelfSignedCert, encryptKeyPem, decryptKeyPem, } from "./cert-issuer.js";
13
13
  export { renderHtmlToPdf } from "./render-pdf.js";
14
- export { signPdf } from "./sign-pdf.js";
14
+ export { signPdf, SUPPORTED_SUBFILTERS, } from "./sign-pdf.js";
15
15
  export { verifyPdfStructure, verifyPdfSignature } from "./verify-pdf.js";
16
16
  export { buildTimeStampReq, parseTimeStampResp, parseTstInfo, OID_TIMESTAMP_TOKEN, } from "./timestamp.js";
17
17
  // ---- Cert lifecycle (stack-agnostic; interface-only) ----
@@ -21,7 +21,7 @@ export { createEnvelope, resolveSigningToken, recordSignature, declineEnvelope,
21
21
  // ---- End-to-end orchestrator ----
22
22
  export { signDocument, } from "./sign-document.js";
23
23
  // ---- Post-quantum hybrid seal (Ed25519 + ML-DSA-65, FIPS 204) ----
24
- export { generatePqKeyBundle, loadPqSigningKeys, publicMaterialForKeys, wrapPqKeyBundle, unwrapPqKeyBundle, buildPqSeal, verifyPqSealSignatures, canonicalJson, PQ_SEAL_VERSION, PQ_SEAL_ALG, } from "./pq-seal.js";
24
+ export { generatePqKeyBundle, loadPqSigningKeys, publicMaterialForKeys, wrapPqKeyBundle, unwrapPqKeyBundle, buildPqSeal, verifyPqSealSignatures, isWellFormedUuaidAssertion, canonicalJson, PQ_SEAL_VERSION, PQ_SEAL_ALG, } from "./pq-seal.js";
25
25
  export { embedPqSeal, extractPqSeal, hasPqSeal } from "./pq-embed.js";
26
26
  export { verifyPqSeal, verifyDocument, } from "./pq-verify.js";
27
27
  export { ensureActivePqKeys, rotatePqKeys, } from "./pq-lifecycle.js";
package/dist/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc;AACd,EAAE;AACF,6EAA6E;AAC7E,+EAA+E;AAC/E,kEAAkE;AAClE,EAAE;AACF,mFAAmF;AACnF,iFAAiF;AACjF,gFAAgF;AAEhF,8BAA8B;AAC9B,OAAO,EAAE,SAAS,EAAuB,MAAM,iBAAiB,CAAC;AACjE,OAAO,EACL,sBAAsB,EACtB,aAAa,EACb,aAAa,GAGd,MAAM,kBAAkB,CAAC;AAC1B,OAAO,EAAE,eAAe,EAA+B,MAAM,iBAAiB,CAAC;AAC/E,OAAO,EAAE,OAAO,EAAyC,MAAM,eAAe,CAAC;AAC/E,OAAO,EA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AAC1B,OAAO,EAAE,eAAe,EAA+B,MAAM,iBAAiB,CAAC;AAC/E,OAAO,EACL,OAAO,EACP,oBAAoB,GAIrB,MAAM,eAAe,CAAC;AACvB,OAAO,EAAE,kBAAkB,EAAE,kBAAkB,EAAqB,MAAM,iBAAiB,CAAC;AAC5F,OAAO,EACL,iBAAiB,EACjB,kBAAkB,EAClB,YAAY,EACZ,mBAAmB,GACpB,MAAM,gBAAgB,CAAC;AAqBxB,4DAA4D;AAC5D,OAAO,EAAE,gBAAgB,EAAyB,MAAM,qBAAqB,CAAC;AAE9E,6DAA6D;AAC7D,OAAO,EACL,cAAc,EACd,mBAAmB,EACnB,eAAe,EACf,eAAe,EACf,YAAY,EACZ,mBAAmB,EACnB,aAAa,GASd,MAAM,eAAe,CAAC;AAEvB,oCAAoC;AACpC,OAAO,EACL,YAAY,GAGb,MAAM,oBAAoB,CAAC;AAE5B,qEAAqE;AACrE,OAAO,EACL,mBAAmB,EACnB,iBAAiB,EACjB,qBAAqB,EACrB,eAAe,EACf,iBAAiB,EACjB,WAAW,EACX,sBAAsB,EACtB,0BAA0B,EAC1B,aAAa,EACb,eAAe,EACf,WAAW,GAQZ,MAAM,cAAc,CAAC;AACtB,OAAO,EAAE,WAAW,EAAE,aAAa,EAAE,SAAS,EAAE,MAAM,eAAe,CAAC;AACtE,OAAO,EACL,YAAY,EACZ,cAAc,GAKf,MAAM,gBAAgB,CAAC;AACxB,OAAO,EACL,kBAAkB,EAClB,YAAY,GAIb,MAAM,mBAAmB,CAAC;AAC3B,OAAO,EACL,qBAAqB,EACrB,qBAAqB,EACrB,sBAAsB,EACtB,iBAAiB,EACjB,YAAY,GAKb,MAAM,cAAc,CAAC"}
@@ -1,8 +1,20 @@
1
1
  import { Signer } from "@signpdf/utils";
2
- import type { TsaTransport } from "./types.js";
2
+ import type { ExternalSigner, TsaTransport } from "./types.js";
3
3
  export interface PemSignerInput {
4
- keyPem: string;
5
- certPem: string;
4
+ /** PEM-encoded RSA private key. Required unless `externalSigner` is provided. */
5
+ keyPem?: string;
6
+ /**
7
+ * PEM-encoded X.509 certificate. Required on the `keyPem` path; on the
8
+ * `externalSigner` path it defaults to `externalSigner.certificatePem`.
9
+ */
10
+ certPem?: string;
11
+ /**
12
+ * External signing seam (HSM / KMS — see `ExternalSigner` in types.ts).
13
+ * Mutually exclusive with `keyPem`. The private key never enters this
14
+ * process; the PKCS#7 signature is produced by `signRsaSha256` (sync or
15
+ * async) over the final signed-attributes SET.
16
+ */
17
+ externalSigner?: ExternalSigner;
6
18
  /**
7
19
  * Optional RFC 3161 timestamp transport. When provided, each produced
8
20
  * signature is upgraded from CAdES-B to CAdES-T by embedding a
@@ -20,7 +32,9 @@ export interface PemSignerInput {
20
32
  padesStrict?: boolean;
21
33
  }
22
34
  export declare class PemSigner extends Signer {
23
- private privateKey;
35
+ /** Present on the in-memory path; absent when an ExternalSigner is used. */
36
+ private privateKey?;
37
+ private externalSigner?;
24
38
  private certificate;
25
39
  private tsa?;
26
40
  private padesStrict;
@@ -28,7 +42,9 @@ export declare class PemSigner extends Signer {
28
42
  lastTimestamped: boolean;
29
43
  /** Set when a non-required TSA call failed (signature falls back to CAdES-B). */
30
44
  lastTsaError?: string;
31
- constructor({ keyPem, certPem, tsa, padesStrict }: PemSignerInput);
45
+ constructor({ keyPem, certPem, tsa, padesStrict, externalSigner }: PemSignerInput);
46
+ /** RSA modulus size in bytes (a PKCS1-v1_5 signature is exactly this long). */
47
+ private modulusBytes;
32
48
  sign(pdfBuffer: Buffer, signingTime?: Date): Promise<Buffer>;
33
49
  /**
34
50
  * Insert the ESS signing-certificate-v2 signed attribute into the first
@@ -36,6 +52,11 @@ export declare class PemSigner extends Signer {
36
52
  * modified set. In `padesStrict` mode the PAdES-forbidden signing-time
37
53
  * attribute is also removed. Returns the new signatureValue (forge binary
38
54
  * string) so the caller can timestamp the FINAL signature.
55
+ *
56
+ * This is the single point where the real signature is produced (the value
57
+ * forge computed during p7.sign() is overwritten unconditionally) — so it is
58
+ * also the ExternalSigner seam: on that path the raw DER of the SET is handed
59
+ * to `signRsaSha256` (awaited; sync or async), instead of the in-memory key.
39
60
  */
40
61
  private addSigningCertV2AndResign;
41
62
  }
@@ -1 +1 @@
1
- {"version":3,"file":"pem-signer.d.ts","sourceRoot":"","sources":["../src/pem-signer.ts"],"names":[],"mappings":"AAqBA,OAAO,EAAE,MAAM,EAAgB,MAAM,gBAAgB,CAAC;AAStD,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,YAAY,CAAC;AAS/C,MAAM,WAAW,cAAc;IAC7B,MAAM,EAAE,MAAM,CAAC;IACf,OAAO,EAAE,MAAM,CAAC;IAChB;;;;;OAKG;IACH,GAAG,CAAC,EAAE,YAAY,CAAC;IACnB;;;;;;OAMG;IACH,WAAW,CAAC,EAAE,OAAO,CAAC;CACvB;AAED,qBAAa,SAAU,SAAQ,MAAM;IACnC,OAAO,CAAC,UAAU,CAA2B;IAC7C,OAAO,CAAC,WAAW,CAAwB;IAC3C,OAAO,CAAC,GAAG,CAAC,CAAe;IAC3B,OAAO,CAAC,WAAW,CAAU;IAE7B,6EAA6E;IACtE,eAAe,UAAS;IAC/B,iFAAiF;IAC1E,YAAY,CAAC,EAAE,MAAM,CAAC;gBAEjB,EAAE,MAAM,EAAE,OAAO,EAAE,GAAG,EAAE,WAAW,EAAE,EAAE,cAAc;IAc3D,IAAI,CAAC,SAAS,EAAE,MAAM,EAAE,WAAW,CAAC,EAAE,IAAI,GAAG,OAAO,CAAC,MAAM,CAAC;IA2ElE;;;;;;OAMG;IACH,OAAO,CAAC,yBAAyB;CAwClC"}
1
+ {"version":3,"file":"pem-signer.d.ts","sourceRoot":"","sources":["../src/pem-signer.ts"],"names":[],"mappings":"AAqBA,OAAO,EAAE,MAAM,EAAgB,MAAM,gBAAgB,CAAC;AAStD,OAAO,KAAK,EAAE,cAAc,EAAyB,YAAY,EAAE,MAAM,YAAY,CAAC;AAgBtF,MAAM,WAAW,cAAc;IAC7B,iFAAiF;IACjF,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB;;;OAGG;IACH,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB;;;;;OAKG;IACH,cAAc,CAAC,EAAE,cAAc,CAAC;IAChC;;;;;OAKG;IACH,GAAG,CAAC,EAAE,YAAY,CAAC;IACnB;;;;;;OAMG;IACH,WAAW,CAAC,EAAE,OAAO,CAAC;CACvB;AAED,qBAAa,SAAU,SAAQ,MAAM;IACnC,4EAA4E;IAC5E,OAAO,CAAC,UAAU,CAAC,CAA2B;IAC9C,OAAO,CAAC,cAAc,CAAC,CAAiB;IACxC,OAAO,CAAC,WAAW,CAAwB;IAC3C,OAAO,CAAC,GAAG,CAAC,CAAe;IAC3B,OAAO,CAAC,WAAW,CAAU;IAE7B,6EAA6E;IACtE,eAAe,UAAS;IAC/B,iFAAiF;IAC1E,YAAY,CAAC,EAAE,MAAM,CAAC;gBAEjB,EAAE,MAAM,EAAE,OAAO,EAAE,GAAG,EAAE,WAAW,EAAE,cAAc,EAAE,EAAE,cAAc;IAuCjF,+EAA+E;IAC/E,OAAO,CAAC,YAAY;IAMd,IAAI,CAAC,SAAS,EAAE,MAAM,EAAE,WAAW,CAAC,EAAE,IAAI,GAAG,OAAO,CAAC,MAAM,CAAC;IAsFlE;;;;;;;;;;;OAWG;YACW,yBAAyB;CAuDxC"}
@@ -21,12 +21,20 @@ import forge from "node-forge";
21
21
  import { Signer, SignPdfError } from "@signpdf/utils";
22
22
  import { buildTimeStampReq, parseTimeStampResp, derStringToUint8, uint8ToDerString, OID_TIMESTAMP_TOKEN, } from "./timestamp.js";
23
23
  const asn1 = forge.asn1;
24
+ /** Expected RSA modulus bit length per ExternalSigner keyType. */
25
+ const EXTERNAL_KEY_BITS = {
26
+ "rsa-2048": 2048,
27
+ "rsa-3072": 3072,
28
+ "rsa-4096": 4096,
29
+ };
24
30
  /** id-aa-signingCertificateV2 (ESS, RFC 5035) — binds the signer cert into the signed data. */
25
31
  const OID_SIGNING_CERT_V2 = "1.2.840.113549.1.9.16.2.47";
26
32
  /** id-signingTime (PKCS#9) — PAdES forbids this signed attribute (time belongs in /M). */
27
33
  const OID_SIGNING_TIME = "1.2.840.113549.1.9.5";
28
34
  export class PemSigner extends Signer {
35
+ /** Present on the in-memory path; absent when an ExternalSigner is used. */
29
36
  privateKey;
37
+ externalSigner;
30
38
  certificate;
31
39
  tsa;
32
40
  padesStrict;
@@ -34,19 +42,45 @@ export class PemSigner extends Signer {
34
42
  lastTimestamped = false;
35
43
  /** Set when a non-required TSA call failed (signature falls back to CAdES-B). */
36
44
  lastTsaError;
37
- constructor({ keyPem, certPem, tsa, padesStrict }) {
45
+ constructor({ keyPem, certPem, tsa, padesStrict, externalSigner }) {
38
46
  super();
39
- if (!keyPem.includes("-----BEGIN")) {
40
- throw new Error("PemSigner: keyPem must be PEM-encoded");
47
+ if (externalSigner) {
48
+ if (keyPem) {
49
+ throw new Error("PemSigner: pass either keyPem or externalSigner, not both");
50
+ }
51
+ const pem = certPem ?? externalSigner.certificatePem;
52
+ if (!pem || !pem.includes("-----BEGIN CERTIFICATE-----")) {
53
+ throw new Error("PemSigner: certPem must be a PEM-encoded X.509 certificate");
54
+ }
55
+ this.certificate = forge.pki.certificateFromPem(pem);
56
+ const expectedBits = EXTERNAL_KEY_BITS[externalSigner.keyType];
57
+ if (!expectedBits) {
58
+ throw new Error(`PemSigner: unsupported externalSigner.keyType "${String(externalSigner.keyType)}"`);
59
+ }
60
+ const actualBits = this.certificate.publicKey.n.bitLength();
61
+ if (actualBits !== expectedBits) {
62
+ throw new Error(`PemSigner: externalSigner.keyType ${externalSigner.keyType} does not match the ` +
63
+ `certificate's RSA modulus (${actualBits} bits)`);
64
+ }
65
+ this.externalSigner = externalSigner;
41
66
  }
42
- if (!certPem.includes("-----BEGIN CERTIFICATE-----")) {
43
- throw new Error("PemSigner: certPem must be a PEM-encoded X.509 certificate");
67
+ else {
68
+ if (!keyPem || !keyPem.includes("-----BEGIN")) {
69
+ throw new Error("PemSigner: keyPem must be PEM-encoded");
70
+ }
71
+ if (!certPem || !certPem.includes("-----BEGIN CERTIFICATE-----")) {
72
+ throw new Error("PemSigner: certPem must be a PEM-encoded X.509 certificate");
73
+ }
74
+ this.privateKey = forge.pki.privateKeyFromPem(keyPem);
75
+ this.certificate = forge.pki.certificateFromPem(certPem);
44
76
  }
45
- this.privateKey = forge.pki.privateKeyFromPem(keyPem);
46
- this.certificate = forge.pki.certificateFromPem(certPem);
47
77
  this.tsa = tsa;
48
78
  this.padesStrict = padesStrict ?? false;
49
79
  }
80
+ /** RSA modulus size in bytes (a PKCS1-v1_5 signature is exactly this long). */
81
+ modulusBytes() {
82
+ return Math.ceil(this.certificate.publicKey.n.bitLength() / 8);
83
+ }
50
84
  async sign(pdfBuffer, signingTime) {
51
85
  if (!Buffer.isBuffer(pdfBuffer)) {
52
86
  throw new SignPdfError("PDF expected as Buffer.", SignPdfError.TYPE_INPUT);
@@ -54,11 +88,20 @@ export class PemSigner extends Signer {
54
88
  // Reset per-call timestamp state (signpdf calls sign() once per signature).
55
89
  this.lastTimestamped = false;
56
90
  this.lastTsaError = undefined;
91
+ // Key handed to forge's synchronous p7.sign() pass. On the externalSigner
92
+ // path this is a placeholder shim: forge only needs an object with a
93
+ // sign(md) method, and the signature it produces here is ALWAYS discarded —
94
+ // addSigningCertV2AndResign() below recomputes the signature over the final
95
+ // (spliced) signed-attributes SET on BOTH paths. Doing the real external
96
+ // call there (in our own async code, with the raw to-be-signed bytes in
97
+ // hand) is what makes async HSM signers possible without a two-pass sign.
98
+ const forgeSigningKey = this.privateKey ??
99
+ placeholderForgeKey(this.modulusBytes());
57
100
  const p7 = forge.pkcs7.createSignedData();
58
101
  p7.content = forge.util.createBuffer(pdfBuffer.toString("binary"));
59
102
  p7.addCertificate(this.certificate);
60
103
  p7.addSigner({
61
- key: this.privateKey,
104
+ key: forgeSigningKey,
62
105
  certificate: this.certificate,
63
106
  digestAlgorithm: forge.pki.oids.sha256,
64
107
  authenticatedAttributes: [
@@ -76,7 +119,7 @@ export class PemSigner extends Signer {
76
119
  // authenticatedAttributes list, so we splice it in and recompute the RSA
77
120
  // signature over the exact bytes. Returns the NEW signatureValue.
78
121
  const p7Asn1 = p7.toAsn1();
79
- const sigValue = this.addSigningCertV2AndResign(p7Asn1);
122
+ const sigValue = await this.addSigningCertV2AndResign(p7Asn1);
80
123
  // No timestamp requested → CAdES-B (now cert-bound).
81
124
  if (!this.tsa) {
82
125
  return Buffer.from(forge.asn1.toDer(p7Asn1).getBytes(), "binary");
@@ -114,8 +157,13 @@ export class PemSigner extends Signer {
114
157
  * modified set. In `padesStrict` mode the PAdES-forbidden signing-time
115
158
  * attribute is also removed. Returns the new signatureValue (forge binary
116
159
  * string) so the caller can timestamp the FINAL signature.
160
+ *
161
+ * This is the single point where the real signature is produced (the value
162
+ * forge computed during p7.sign() is overwritten unconditionally) — so it is
163
+ * also the ExternalSigner seam: on that path the raw DER of the SET is handed
164
+ * to `signRsaSha256` (awaited; sync or async), instead of the in-memory key.
117
165
  */
118
- addSigningCertV2AndResign(p7Asn1) {
166
+ async addSigningCertV2AndResign(p7Asn1) {
119
167
  const signerInfo = firstSignerInfoSeq(p7Asn1);
120
168
  const siChildren = signerInfo.value;
121
169
  // signedAttrs = the [0] IMPLICIT context node; encryptedDigest = the
@@ -144,13 +192,36 @@ export class PemSigner extends Signer {
144
192
  signedAttrs.value = attrs;
145
193
  // Re-sign: RSA over DER(signedAttrs re-tagged as SET OF), SHA-256.
146
194
  const setDer = asn1.toDer(asn1.create(asn1.Class.UNIVERSAL, asn1.Type.SET, true, attrs)).getBytes();
147
- const md = forge.md.sha256.create();
148
- md.update(setDer);
149
- const newSig = this.privateKey.sign(md); // RSASSA-PKCS1-V1_5 (forge default)
195
+ let newSig;
196
+ if (this.externalSigner) {
197
+ // External seam: RSASSA-PKCS1-v1_5/SHA-256 over the same raw bytes —
198
+ // byte-identical to forge's key.sign(md) for the same key.
199
+ const sig = await this.externalSigner.signRsaSha256(derStringToUint8(setDer));
200
+ const expected = this.modulusBytes();
201
+ if (!(sig instanceof Uint8Array) || sig.length !== expected) {
202
+ throw new Error(`PemSigner: externalSigner.signRsaSha256 returned ${sig instanceof Uint8Array ? sig.length : typeof sig} bytes; expected exactly ${expected} (RSASSA-PKCS1-v1_5 signatures are modulus-sized)`);
203
+ }
204
+ newSig = uint8ToDerString(sig);
205
+ }
206
+ else {
207
+ const md = forge.md.sha256.create();
208
+ md.update(setDer);
209
+ newSig = this.privateKey.sign(md); // RSASSA-PKCS1-V1_5 (forge default)
210
+ }
150
211
  sigOctet.value = newSig;
151
212
  return newSig;
152
213
  }
153
214
  }
215
+ /**
216
+ * Stand-in key for forge's internal (always-discarded) signing pass on the
217
+ * ExternalSigner path. node-forge accepts any object with a `sign(md)` method
218
+ * as a SignerInfo key; this one emits modulus-sized zero bytes so the ASN.1
219
+ * tree has a correctly-shaped signature OCTET STRING until
220
+ * addSigningCertV2AndResign() overwrites it with the real external signature.
221
+ */
222
+ function placeholderForgeKey(modulusBytes) {
223
+ return { sign: () => "\x00".repeat(modulusBytes) };
224
+ }
154
225
  /**
155
226
  * Build the ESS signing-certificate-v2 signed attribute (RFC 5035) binding the
156
227
  * signer certificate into the signed data:
@@ -1 +1 @@
1
- {"version":3,"file":"pem-signer.js","sourceRoot":"","sources":["../src/pem-signer.ts"],"names":[],"mappings":"AAAA,+CAA+C;AAC/C,EAAE;AACF,wEAAwE;AACxE,EAAE;AACF,0EAA0E;AAC1E,6EAA6E;AAC7E,kFAAkF;AAClF,EAAE;AACF,gFAAgF;AAChF,4EAA4E;AAC5E,gFAAgF;AAChF,+EAA+E;AAC/E,4EAA4E;AAC5E,+EAA+E;AAC/E,iDAAiD;AACjD,EAAE;AACF,8EAA8E;AAC9E,+EAA+E;AAC/E,gBAAgB;AAEhB,OAAO,KAAK,MAAM,YAAY,CAAC;AAC/B,OAAO,EAAE,MAAM,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAEtD,OAAO,EACL,iBAAi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K,CAAC,EAC1B,CAAC;YACD,WAAW,GAAG,KAAK,CAAC,CAAC,gCAAgC;QACvD,CAAC;IACH,CAAC;IACD,IAAI,CAAC,WAAW,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,WAAW,CAAC,KAAK,CAAC,IAAI,WAAW,CAAC,KAAK,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;QACxF,MAAM,IAAI,KAAK,CAAC,2CAA2C,CAAC,CAAC;IAC/D,CAAC;IAED,MAAM,UAAU,GAAG,WAAW,CAAC,KAAK,CAAC,CAAC,CAAoB,CAAC;IAC3D,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,UAAU,CAAC,KAAK,CAAC,EAAE,CAAC;QACrC,MAAM,IAAI,KAAK,CAAC,+CAA+C,CAAC,CAAC;IACnE,CAAC;IAEA,UAAU,CAAC,KAA2B,CAAC,IAAI,CAAC,aAAa,CAAC,CAAC;AAC9D,CAAC"}
package/dist/pq-seal.d.ts CHANGED
@@ -5,6 +5,18 @@ export declare const PQ_SEAL_VERSION: 1;
5
5
  export declare const PQ_SEAL_ALG: "hybrid-ed25519-ml-dsa-65";
6
6
  /** Bundle schema version for the wrapped at-rest key material. */
7
7
  declare const PQ_BUNDLE_VERSION: 1;
8
+ /**
9
+ * True if `value` is a structurally well-formed UUAID assertion — the exact rule
10
+ * `buildPqSeal` enforces on input and `verifyPqSealSignatures` enforces on a
11
+ * seal that carries one. This is an envelope check, NOT proof that the
12
+ * identifier resolves, exists, or belongs to the signer.
13
+ *
14
+ * Accepted here does NOT imply accepted by the UUAID registry: the registry
15
+ * additionally enforces semantics this package deliberately does not know
16
+ * (registered subject classes and object types, canonical UUID form). Expect a
17
+ * band of identifiers this will sign and a resolver will still reject.
18
+ */
19
+ export declare function isWellFormedUuaidAssertion(value: unknown): value is string;
8
20
  /**
9
21
  * The wrappable at-rest key bundle. Persist `wrapPqKeyBundle(bundle, passphrase)`;
10
22
  * never store the raw bundle. Compact by design: an Ed25519 PKCS#8 key plus a
@@ -55,6 +67,14 @@ export interface PqSeal {
55
67
  signedAt: string;
56
68
  /** 128-bit hex id over both public keys. */
57
69
  keyId: string;
70
+ /**
71
+ * OPTIONAL signer-asserted UUAID (IAASO-0004 attribution). Omitted entirely
72
+ * unless the signer supplies one. Signed like every other payload field, so it
73
+ * is immutable once sealed — but it is a CLAIM by the seal key, not proof of
74
+ * identity: it binds key -> uuaid only. See the identity note at the top of
75
+ * this file before relying on it for attribution.
76
+ */
77
+ uuaid?: string;
58
78
  keys: {
59
79
  ed25519: string;
60
80
  mldsa65: string;
@@ -77,15 +97,36 @@ export interface PqSealVerification {
77
97
  fingerprintOk: boolean;
78
98
  /** The embedded `keyId` matches the digest of the two public keys it claims. */
79
99
  keyIdOk: boolean;
80
- /** Hybrid verdict: every check passed (both signatures + fingerprint + keyId). */
100
+ /**
101
+ * The seal either asserts no UUAID, or asserts a structurally well-formed one.
102
+ * A seal carrying a malformed `uuaid` is rejected (fail-closed) even though its
103
+ * signatures are intact — a hand-crafted identity field is not something to
104
+ * pass downstream. True does NOT mean the assertion was verified.
105
+ */
106
+ uuaidOk: boolean;
107
+ /** Hybrid verdict: every check passed (both signatures + fingerprint + keyId + uuaid shape). */
81
108
  ok: boolean;
82
109
  }
110
+ export interface GeneratePqKeyBundleOptions {
111
+ /**
112
+ * 32-byte ML-DSA-65 keygen seed. The same seed always derives the same
113
+ * keypair — supply one for deterministic key provisioning (e.g. from a KMS
114
+ * or sealed secret). Omit for a fresh random seed.
115
+ */
116
+ mldsa65Seed?: Uint8Array;
117
+ /**
118
+ * PKCS#8 DER Ed25519 private key to use instead of generating a fresh one.
119
+ * Together with `mldsa65Seed` this makes the whole bundle deterministic.
120
+ */
121
+ ed25519Pkcs8?: Uint8Array;
122
+ }
83
123
  /**
84
124
  * Generate a fresh hybrid key bundle plus its derived public material. The bundle
85
125
  * is what you wrap + persist; the public material is what you publish/pin as the
86
- * signer's post-quantum identity.
126
+ * signer's post-quantum identity. Pass `opts` to provision deterministically
127
+ * from existing key material instead of random generation.
87
128
  */
88
- export declare function generatePqKeyBundle(): {
129
+ export declare function generatePqKeyBundle(opts?: GeneratePqKeyBundleOptions): {
89
130
  bundle: PqKeyBundle;
90
131
  public: PqPublicMaterial;
91
132
  };
@@ -105,6 +146,15 @@ export interface BuildPqSealInput {
105
146
  keys: PqSigningKeys;
106
147
  /** Seal timestamp. Defaults to now. */
107
148
  signedAt?: Date;
149
+ /**
150
+ * OPTIONAL UUAID to assert as the signer identity (IAASO-0004 attribution).
151
+ * Omit — the default — to produce a seal byte-identical to pre-`uuaid` output.
152
+ * Rejected at build time unless structurally well-formed, so a malformed
153
+ * identifier can never be signed into a document. That check is structural
154
+ * only: passing it does not mean the UUAID registry will resolve or accept the
155
+ * identifier (see `isWellFormedUuaidAssertion`).
156
+ */
157
+ uuaid?: string;
108
158
  }
109
159
  /**
110
160
  * Produce a hybrid seal over `digestHex`. Both signatures are computed over the
@@ -1 +1 @@
1
- {"version":3,"file":"pq-seal.d.ts","sourceRoot":"","sources":["../src/pq-seal.ts"],"names":[],"mappings":"AA0BA,OAAO,MAAM,MAAM,aAAa,CAAC;AAOjC,oFAAoF;AACpF,eAAO,MAAM,eAAe,EAAG,CAAU,CAAC;AAC1C,yEAAyE;AACzE,eAAO,MAAM,WAAW,EAAG,0BAAmC,CAAC;AAC/D,kEAAkE;AAClE,QAAA,MAAM,iBAAiB,EAAG,CAAU,CAAC;AAkBrC;;;;;GAKG;AACH,MAAM,WAAW,WAAW;IAC1B,CAAC,EAAE,OAAO,iBAAiB,CAAC;IAC5B,oDAAoD;IACpD,YAAY,EAAE,MAAM,CAAC;IACrB,qCAAqC;IACrC,WAAW,EAAE,MAAM,CAAC;CACrB;AAED,8FAA8F;AAC9F,MAAM,WAAW,gBAAgB;IAC/B,6CAA6C;IAC7C,OAAO,EAAE,MAAM,CAAC;IAChB,iDAAiD;IACjD,OAAO,EAAE,MAAM,CAAC;IAChB,2FAA2F;IAC3F,UAAU,EAAE,MAAM,CAAC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G,MAAM,CAiC3D;AAED;;;;;;;GAOG;AACH,wBAAgB,sBAAsB,CAAC,IAAI,EAAE,MAAM,GAAG,kBAAkB,CAqEvE;AA2CD;;;;;;GAMG;AACH,wBAAgB,aAAa,CAAC,KAAK,EAAE,OAAO,GAAG,MAAM,CAUpD"}
package/dist/pq-seal.js CHANGED
@@ -20,6 +20,29 @@
20
20
  // A self-signed ML-DSA-65 X.509 certificate (RFC 9881 OID 2.16.840.1.101.3.4.3.18)
21
21
  // is a deliberate fast-follow, not required to ship the seal.
22
22
  //
23
+ // Optional signer-asserted UUAID (`uuaid`): a signer MAY additionally assert the
24
+ // UUAID identity it signs as, for IAASO-0004 (Media Provenance & Attribution)
25
+ // attribution. The field is part of the signed payload, so it is bound under BOTH
26
+ // schemes and cannot be added, removed or swapped on an existing seal.
27
+ //
28
+ // What it proves: the holder of THIS seal key claims to be THAT UUAID.
29
+ // What it does NOT: that the UUAID's owner authorised this document.
30
+ //
31
+ // It is one half of a mutual binding (key -> uuaid). The other half (uuaid -> key,
32
+ // i.e. the UUAID owner authenticating this seal key as theirs) lives in the UUAID
33
+ // registry and is NOT established here. A relying party MUST NOT treat a bare
34
+ // `uuaid` assertion as attribution: unmatched, it is worth exactly the TOFU
35
+ // fingerprint next to it. Absent the second direction, an attacker who can mint
36
+ // any seal can assert any UUAID.
37
+ //
38
+ // Backward compatibility: the field is omitted entirely when not supplied, so
39
+ // seals from callers that never set it are byte-identical to pre-`uuaid` output,
40
+ // and verifiers that predate the field still verify uuaid-bearing seals (the
41
+ // signed payload is reconstructed generically as "the seal minus `sig`"). This is
42
+ // why the field is additive at v1 rather than a version bump: bumping
43
+ // PQ_SEAL_VERSION would break every already-deployed verifier, the added field
44
+ // does not.
45
+ //
23
46
  // Algorithm binding: both signatures are computed over the SAME canonical bytes —
24
47
  // the seal object minus its `sig` field — so digest, covered length, public keys,
25
48
  // timestamp and keyId are all bound together and cannot be swapped independently.
@@ -45,17 +68,65 @@ const MLDSA65_SIGNATURE_LEN = 3309;
45
68
  const MLDSA65_SEED_LEN = 32;
46
69
  const ED25519_RAW_PUBLIC_LEN = 32;
47
70
  const ED25519_SIGNATURE_LEN = 64;
48
- // ---------- Key generation / loading ----------
71
+ /** Upper bound on an asserted UUAID string — bounds the seal, not the namespace. */
72
+ const UUAID_MAX_LEN = 255;
73
+ /**
74
+ * Structural shape of a UUAID: `uuaid:` followed by three or four
75
+ * `[A-Za-z0-9_-]` segments — covering both the compact profile
76
+ * (`uuaid:foundation:<objectType>:<uuid>`) and the federated profile
77
+ * (`uuaid:<subjectClass>:<jurisdiction>:<authority>:<localId>`).
78
+ *
79
+ * Deliberately structural only. Which subject classes and object types exist is
80
+ * a registry that evolves in the UUAID lane; hard-coding that enum here would
81
+ * make this package reject newly-registered-but-valid identifiers until it is
82
+ * republished, and it would bake another system's policy into a signed wire
83
+ * format. Semantic validation and resolution belong to the UUAID verifier.
84
+ */
85
+ const UUAID_ASSERTION_RE = /^uuaid:[A-Za-z0-9_-]+:[A-Za-z0-9_-]+:[A-Za-z0-9_-]+(?::[A-Za-z0-9_-]+)?$/;
86
+ /**
87
+ * True if `value` is a structurally well-formed UUAID assertion — the exact rule
88
+ * `buildPqSeal` enforces on input and `verifyPqSealSignatures` enforces on a
89
+ * seal that carries one. This is an envelope check, NOT proof that the
90
+ * identifier resolves, exists, or belongs to the signer.
91
+ *
92
+ * Accepted here does NOT imply accepted by the UUAID registry: the registry
93
+ * additionally enforces semantics this package deliberately does not know
94
+ * (registered subject classes and object types, canonical UUID form). Expect a
95
+ * band of identifiers this will sign and a resolver will still reject.
96
+ */
97
+ export function isWellFormedUuaidAssertion(value) {
98
+ return typeof value === "string" && value.length <= UUAID_MAX_LEN && UUAID_ASSERTION_RE.test(value);
99
+ }
49
100
  /**
50
101
  * Generate a fresh hybrid key bundle plus its derived public material. The bundle
51
102
  * is what you wrap + persist; the public material is what you publish/pin as the
52
- * signer's post-quantum identity.
103
+ * signer's post-quantum identity. Pass `opts` to provision deterministically
104
+ * from existing key material instead of random generation.
53
105
  */
54
- export function generatePqKeyBundle() {
55
- const { publicKey, privateKey } = crypto.generateKeyPairSync("ed25519");
56
- const ed25519Pkcs8 = privateKey.export({ type: "pkcs8", format: "der" });
57
- const ed25519PublicRaw = rawEd25519FromKeyObject(publicKey);
58
- const seed = crypto.randomBytes(MLDSA65_SEED_LEN);
106
+ export function generatePqKeyBundle(opts = {}) {
107
+ let ed25519Pkcs8;
108
+ let ed25519PublicRaw;
109
+ if (opts.ed25519Pkcs8) {
110
+ const privateKey = crypto.createPrivateKey({
111
+ key: Buffer.from(opts.ed25519Pkcs8),
112
+ format: "der",
113
+ type: "pkcs8",
114
+ });
115
+ if (privateKey.asymmetricKeyType !== "ed25519") {
116
+ throw new Error(`generatePqKeyBundle: ed25519Pkcs8 must be an Ed25519 key, got ${privateKey.asymmetricKeyType}`);
117
+ }
118
+ ed25519Pkcs8 = Buffer.from(opts.ed25519Pkcs8);
119
+ ed25519PublicRaw = rawEd25519FromKeyObject(crypto.createPublicKey(privateKey));
120
+ }
121
+ else {
122
+ const { publicKey, privateKey } = crypto.generateKeyPairSync("ed25519");
123
+ ed25519Pkcs8 = privateKey.export({ type: "pkcs8", format: "der" });
124
+ ed25519PublicRaw = rawEd25519FromKeyObject(publicKey);
125
+ }
126
+ if (opts.mldsa65Seed && opts.mldsa65Seed.length !== MLDSA65_SEED_LEN) {
127
+ throw new Error(`generatePqKeyBundle: mldsa65Seed must be ${MLDSA65_SEED_LEN} bytes, got ${opts.mldsa65Seed.length}`);
128
+ }
129
+ const seed = opts.mldsa65Seed ? Buffer.from(opts.mldsa65Seed) : crypto.randomBytes(MLDSA65_SEED_LEN);
59
130
  const { publicKey: mldsa65PublicKey } = ml_dsa65.keygen(seed);
60
131
  const bundle = {
61
132
  v: PQ_BUNDLE_VERSION,
@@ -116,6 +187,9 @@ export function buildPqSeal(input) {
116
187
  if (!Number.isInteger(input.coveredBytes) || input.coveredBytes <= 0) {
117
188
  throw new Error("buildPqSeal: coveredBytes must be a positive integer");
118
189
  }
190
+ if (input.uuaid !== undefined && !isWellFormedUuaidAssertion(input.uuaid)) {
191
+ throw new Error("buildPqSeal: uuaid must be a well-formed UUAID (uuaid:<3-or-4 segments>) — refusing to sign a malformed identity claim");
192
+ }
119
193
  const pub = publicMaterialForKeys(input.keys);
120
194
  const payload = {
121
195
  v: PQ_SEAL_VERSION,
@@ -125,6 +199,10 @@ export function buildPqSeal(input) {
125
199
  coveredBytes: input.coveredBytes,
126
200
  signedAt: (input.signedAt ?? new Date()).toISOString(),
127
201
  keyId: pub.keyId,
202
+ // Spread-in rather than `uuaid: input.uuaid` so the key is ABSENT (not
203
+ // `undefined`) when unused — canonicalJson would otherwise serialize it and
204
+ // change the signed bytes of every seal that never asked for attribution.
205
+ ...(input.uuaid !== undefined ? { uuaid: input.uuaid } : {}),
128
206
  keys: { ed25519: pub.ed25519, mldsa65: pub.mldsa65, mldsa65Fpr: pub.mldsa65Fpr },
129
207
  };
130
208
  const signingInput = Buffer.from(canonicalJson(payload), "utf8");
@@ -146,6 +224,7 @@ export function verifyPqSealSignatures(seal) {
146
224
  mldsa65: false,
147
225
  fingerprintOk: false,
148
226
  keyIdOk: false,
227
+ uuaidOk: false,
149
228
  ok: false,
150
229
  };
151
230
  try {
@@ -179,6 +258,10 @@ export function verifyPqSealSignatures(seal) {
179
258
  .digest("hex")
180
259
  .slice(0, 32);
181
260
  const keyIdOk = seal.keyId === expectedKeyId;
261
+ // An absent `uuaid` asserts nothing and is fine; a present one must be
262
+ // structurally sound. Both cases are already covered by the signatures —
263
+ // this only rejects identity fields no honest signer could have produced.
264
+ const uuaidOk = seal.uuaid === undefined || isWellFormedUuaidAssertion(seal.uuaid);
182
265
  let ed25519 = false;
183
266
  try {
184
267
  ed25519 = crypto.verify(null, signingInput, ed25519RawToPublicKey(ed25519Pub), ed25519Sig);
@@ -198,7 +281,8 @@ export function verifyPqSealSignatures(seal) {
198
281
  mldsa65,
199
282
  fingerprintOk,
200
283
  keyIdOk,
201
- ok: ed25519 && mldsa65 && fingerprintOk && keyIdOk,
284
+ uuaidOk,
285
+ ok: ed25519 && mldsa65 && fingerprintOk && keyIdOk && uuaidOk,
202
286
  };
203
287
  }
204
288
  catch {