gdc-common-utils-ts 1.10.0 → 1.11.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.
@@ -14,6 +14,29 @@ export declare const CommunicationKeyPurposes: {
14
14
  readonly CommunicationSignature: "comm_sig";
15
15
  readonly VerifiableCredentialSignature: "vc_sign";
16
16
  };
17
+ /**
18
+ * Classical JOSE signature algorithms currently recognized across GDC VP/JWT
19
+ * examples and gateway trust adapters.
20
+ *
21
+ * Notes:
22
+ * - `ES256K` is the JOSE name for ECDSA over `secp256k1`
23
+ * - `ES384` remains the common P-384 legacy example in current GW fixtures
24
+ */
25
+ export declare const ClassicalJoseSignatureAlgorithms: {
26
+ readonly Es256: "ES256";
27
+ readonly Es256K: "ES256K";
28
+ readonly Es384: "ES384";
29
+ };
30
+ /**
31
+ * JOSE signature algorithms accepted by shared VP/JWT helpers.
32
+ *
33
+ * This intentionally covers both:
34
+ * - classical ECDSA JOSE algorithms (`ES256`, `ES256K`, `ES384`)
35
+ * - post-quantum ML-DSA JOSE algorithm labels already used by GW
36
+ *
37
+ * Use this type when a helper builds or documents a JWS/JWT/VP proof header.
38
+ */
39
+ export type JoseSignatureAlgorithm = typeof ClassicalJoseSignatureAlgorithms[keyof typeof ClassicalJoseSignatureAlgorithms] | MldsaAlg;
17
40
  /**
18
41
  * Default post-quantum signing algorithms used for communication bootstrap.
19
42
  */
@@ -15,6 +15,19 @@ export const CommunicationKeyPurposes = {
15
15
  CommunicationSignature: 'comm_sig',
16
16
  VerifiableCredentialSignature: 'vc_sign',
17
17
  };
18
+ /**
19
+ * Classical JOSE signature algorithms currently recognized across GDC VP/JWT
20
+ * examples and gateway trust adapters.
21
+ *
22
+ * Notes:
23
+ * - `ES256K` is the JOSE name for ECDSA over `secp256k1`
24
+ * - `ES384` remains the common P-384 legacy example in current GW fixtures
25
+ */
26
+ export const ClassicalJoseSignatureAlgorithms = {
27
+ Es256: 'ES256',
28
+ Es256K: 'ES256K',
29
+ Es384: 'ES384',
30
+ };
18
31
  /**
19
32
  * Default post-quantum signing algorithms used for communication bootstrap.
20
33
  */
@@ -14,4 +14,5 @@ export * from './network';
14
14
  export * from './sectors';
15
15
  export * from './smart';
16
16
  export * from './service-capabilities';
17
+ export * from './urn';
17
18
  export * from './verifiable-credentials';
@@ -14,4 +14,5 @@ export * from './network.js';
14
14
  export * from './sectors.js';
15
15
  export * from './smart.js';
16
16
  export * from './service-capabilities.js';
17
+ export * from './urn.js';
17
18
  export * from './verifiable-credentials.js';
@@ -6,6 +6,29 @@ export declare enum ClaimsServiceSchemaorg {
6
6
  termsOfService = "org.schema.Service.termsOfService",
7
7
  url = "org.schema.Service.url"
8
8
  }
9
+ /**
10
+ * Canonical claim names used by the current GDC profile when a VC models a
11
+ * `schema.org/SoftwareApplication`.
12
+ *
13
+ * Contract note:
14
+ * - `material` is the public cryptographic material of the software
15
+ * application in the current GDC profile, typically the communication
16
+ * signing key id bound by ICA to the software/application instance
17
+ * - when that identifier is expressed as a JWK thumbprint, RFC 7638 defines
18
+ * the canonical thumbprint calculation over the public signing /
19
+ * verification JWK and RFC 9278 defines the canonical URN form
20
+ * `urn:ietf:params:oauth:jwk-thumbprint:sha-256:<base64url>`
21
+ * - the controller-side signature belongs to the prior ICA registration step,
22
+ * not to every later app-service operational proof
23
+ */
24
+ export declare enum ClaimsSoftwareApplicationSchemaorg {
25
+ id = "org.schema.SoftwareApplication.id",
26
+ name = "org.schema.SoftwareApplication.name",
27
+ url = "org.schema.SoftwareApplication.url",
28
+ sameAs = "org.schema.SoftwareApplication.sameAs",
29
+ /** Communication signing key id bound by the ICA-issued SoftwareApplication VC. */
30
+ material = "org.schema.SoftwareApplication.material"
31
+ }
9
32
  /**
10
33
  * Defines the canonical claim names for the 'org.schema' context,
11
34
  * based on Schema.org vocabulary.
@@ -39,6 +62,16 @@ export declare enum ClaimsOrganizationSchemaorg {
39
62
  email = "org.schema.Organization.email",
40
63
  /** Public contact phone */
41
64
  telephone = "org.schema.Organization.telephone",
65
+ /**
66
+ * Public cryptographic material of the organization in VC/profile payloads.
67
+ *
68
+ * When represented as a JWK thumbprint identifier:
69
+ * - RFC 7638 defines the canonical thumbprint calculation over the public
70
+ * signing / verification JWK
71
+ * - RFC 9278 defines the canonical URN form
72
+ * `urn:ietf:params:oauth:jwk-thumbprint:sha-256:<base64url>`
73
+ */
74
+ hasCredentialMaterial = "org.schema.Organization.hasCredential.material",
42
75
  /** Individual/family owner email used by subject-index registration flows. */
43
76
  ownerEmail = "org.schema.Organization.owner.email",
44
77
  /** Individual/family owner telephone used by subject-index registration flows. */
@@ -8,6 +8,30 @@ export var ClaimsServiceSchemaorg;
8
8
  ClaimsServiceSchemaorg["termsOfService"] = "org.schema.Service.termsOfService";
9
9
  ClaimsServiceSchemaorg["url"] = "org.schema.Service.url";
10
10
  })(ClaimsServiceSchemaorg || (ClaimsServiceSchemaorg = {}));
11
+ /**
12
+ * Canonical claim names used by the current GDC profile when a VC models a
13
+ * `schema.org/SoftwareApplication`.
14
+ *
15
+ * Contract note:
16
+ * - `material` is the public cryptographic material of the software
17
+ * application in the current GDC profile, typically the communication
18
+ * signing key id bound by ICA to the software/application instance
19
+ * - when that identifier is expressed as a JWK thumbprint, RFC 7638 defines
20
+ * the canonical thumbprint calculation over the public signing /
21
+ * verification JWK and RFC 9278 defines the canonical URN form
22
+ * `urn:ietf:params:oauth:jwk-thumbprint:sha-256:<base64url>`
23
+ * - the controller-side signature belongs to the prior ICA registration step,
24
+ * not to every later app-service operational proof
25
+ */
26
+ export var ClaimsSoftwareApplicationSchemaorg;
27
+ (function (ClaimsSoftwareApplicationSchemaorg) {
28
+ ClaimsSoftwareApplicationSchemaorg["id"] = "org.schema.SoftwareApplication.id";
29
+ ClaimsSoftwareApplicationSchemaorg["name"] = "org.schema.SoftwareApplication.name";
30
+ ClaimsSoftwareApplicationSchemaorg["url"] = "org.schema.SoftwareApplication.url";
31
+ ClaimsSoftwareApplicationSchemaorg["sameAs"] = "org.schema.SoftwareApplication.sameAs";
32
+ /** Communication signing key id bound by the ICA-issued SoftwareApplication VC. */
33
+ ClaimsSoftwareApplicationSchemaorg["material"] = "org.schema.SoftwareApplication.material";
34
+ })(ClaimsSoftwareApplicationSchemaorg || (ClaimsSoftwareApplicationSchemaorg = {}));
11
35
  /**
12
36
  * Defines the canonical claim names for the 'org.schema' context,
13
37
  * based on Schema.org vocabulary.
@@ -42,6 +66,16 @@ export var ClaimsOrganizationSchemaorg;
42
66
  ClaimsOrganizationSchemaorg["email"] = "org.schema.Organization.email";
43
67
  /** Public contact phone */
44
68
  ClaimsOrganizationSchemaorg["telephone"] = "org.schema.Organization.telephone";
69
+ /**
70
+ * Public cryptographic material of the organization in VC/profile payloads.
71
+ *
72
+ * When represented as a JWK thumbprint identifier:
73
+ * - RFC 7638 defines the canonical thumbprint calculation over the public
74
+ * signing / verification JWK
75
+ * - RFC 9278 defines the canonical URN form
76
+ * `urn:ietf:params:oauth:jwk-thumbprint:sha-256:<base64url>`
77
+ */
78
+ ClaimsOrganizationSchemaorg["hasCredentialMaterial"] = "org.schema.Organization.hasCredential.material";
45
79
  /** Individual/family owner email used by subject-index registration flows. */
46
80
  ClaimsOrganizationSchemaorg["ownerEmail"] = "org.schema.Organization.owner.email";
47
81
  /** Individual/family owner telephone used by subject-index registration flows. */
@@ -0,0 +1,11 @@
1
+ /**
2
+ * Canonical URN prefixes reused across bootstrap and proof examples.
3
+ *
4
+ * The JWK thumbprint URI prefix below follows RFC 9278 and is intended for
5
+ * cases where a key identifier is represented as a normalized URI instead of
6
+ * as a bare base64url thumbprint value.
7
+ */
8
+ export declare const UrnPrefixes: Readonly<{
9
+ readonly JwkThumbprintSha256KeyId: "urn:ietf:params:oauth:jwk-thumbprint:sha-256:";
10
+ }>;
11
+ export type UrnPrefix = typeof UrnPrefixes[keyof typeof UrnPrefixes];
@@ -0,0 +1,11 @@
1
+ // Copyright 2026 Antifraud Services Inc. under the Apache License, Version 2.0.
2
+ /**
3
+ * Canonical URN prefixes reused across bootstrap and proof examples.
4
+ *
5
+ * The JWK thumbprint URI prefix below follows RFC 9278 and is intended for
6
+ * cases where a key identifier is represented as a normalized URI instead of
7
+ * as a bare base64url thumbprint value.
8
+ */
9
+ export const UrnPrefixes = Object.freeze({
10
+ JwkThumbprintSha256KeyId: 'urn:ietf:params:oauth:jwk-thumbprint:sha-256:',
11
+ });
@@ -2,33 +2,42 @@
2
2
  * Shared synthetic ICA activation-proof fixtures reused by docs/tests.
3
3
  *
4
4
  * Contract note:
5
- * - issuer/holder/audience DIDs, VC subtype names, and representative binding
6
- * fields must be imported from this module instead of re-hardcoded inline
5
+ * - controller-signing/audience ids and VC subtype names must be imported from
6
+ * this module instead of re-hardcoded
7
+ * inline
7
8
  * - the representative `hasCredential.material` shape below reflects the
8
9
  * current `activation-policy` helper contract; if ICA finalizes a different
9
10
  * VC shape, update this module first and then the dependent helpers/tests
11
+ *
12
+ * Modeling note:
13
+ * - this onboarding example intentionally anchors the business subject on the
14
+ * organization tax ID rather than on a pre-existing provider DID
15
+ * - the VP envelope uses a synthetic RFC 7638-style JWK-thumbprint urn and a
16
+ * host id, which better matches the initial registration stage than a
17
+ * synthetic did:web
18
+ */
19
+ /**
20
+ * Synthetic JWK-thumbprint-based signing key id for the organization
21
+ * controller who signs the initial legal-onboarding VP.
10
22
  */
11
- export declare const EXAMPLE_ICA_VP_ISSUER_DID: "did:web:controller.example.org";
12
- export declare const EXAMPLE_ICA_VP_AUDIENCE_DID: "did:web:host.example.com";
13
- export declare const EXAMPLE_ICA_VP_HOLDER_DID: "did:web:controller.example.org";
14
- export declare const EXAMPLE_ICA_ORGANIZATION_DID: "did:web:org.example.org";
15
- export declare const EXAMPLE_ICA_REPRESENTATIVE_DID: "did:web:rep.example.org";
16
- export declare const EXAMPLE_ICA_ORGANIZATION_TAX_ID: "ESB00112233";
17
- export declare const EXAMPLE_ICA_REPRESENTATIVE_ROLE_CODE: "RESPRSN";
18
- export declare const EXAMPLE_ICA_REPRESENTATIVE_BINDING_MATERIAL: "controller-sig-kid";
19
- export declare const EXAMPLE_ICA_ORGANIZATION_CREDENTIAL: Readonly<{
23
+ export declare const EXAMPLE_ORG_CONTROLLER_SIGNING_KEY_ID: "urn:ietf:params:oauth:jwk-thumbprint:sha-256:Q0ZfM0V4YW1wbGVUaHVtYnByaW50X2Jhc2U2NHVybA";
24
+ export declare const EXAMPLE_PRESENTATION_AUDIENCE_HOST_ID: "host:node-operator-es";
25
+ export declare const EXAMPLE_ORGANIZATION_TAX_ID: "ESB00112233";
26
+ export declare const EXAMPLE_REPRESENTATIVE_ROLE_CODE: "RESPRSN";
27
+ export declare const EXAMPLE_ORGANIZATION_ID: "ESB00112233";
28
+ export declare const EXAMPLE_ORG_ACTIVATION_ORGANIZATION_CREDENTIAL: Readonly<{
20
29
  '@context': string[];
21
30
  type: ("VerifiableCredential" | "OrganizationCredential")[];
22
31
  credentialSubject: {
23
- id: "did:web:org.example.org";
32
+ id: "ESB00112233";
24
33
  taxID: "ESB00112233";
25
34
  };
26
35
  }>;
27
- export declare const EXAMPLE_ICA_LEGAL_REPRESENTATIVE_CREDENTIAL: Readonly<{
36
+ export declare const EXAMPLE_ORG_ACTIVATION_LEGAL_REPRESENTATIVE_CREDENTIAL: Readonly<{
28
37
  '@context': string[];
29
38
  type: ("VerifiableCredential" | "LegalRepresentativeCredential")[];
30
39
  credentialSubject: {
31
- id: "did:web:rep.example.org";
40
+ id: "urn:ietf:params:oauth:jwk-thumbprint:sha-256:Q0ZfM0V4YW1wbGVUaHVtYnByaW50X2Jhc2U2NHVybA";
32
41
  memberOf: {
33
42
  taxID: "ESB00112233";
34
43
  };
@@ -38,18 +47,18 @@ export declare const EXAMPLE_ICA_LEGAL_REPRESENTATIVE_CREDENTIAL: Readonly<{
38
47
  };
39
48
  };
40
49
  hasCredential: {
41
- material: "controller-sig-kid";
50
+ material: "urn:ietf:params:oauth:jwk-thumbprint:sha-256:Q0ZfM0V4YW1wbGVUaHVtYnByaW50X2Jhc2U2NHVybA";
42
51
  };
43
52
  };
44
53
  }>;
45
- export declare const EXAMPLE_ICA_ACTIVATION_VP_PAYLOAD: Readonly<{
46
- iss: "did:web:controller.example.org";
47
- sub: "did:web:controller.example.org";
48
- aud: "did:web:host.example.com";
54
+ export declare const EXAMPLE_ORG_ACTIVATION_PROOF_VP_PAYLOAD: Readonly<{
55
+ iss: "urn:ietf:params:oauth:jwk-thumbprint:sha-256:Q0ZfM0V4YW1wbGVUaHVtYnByaW50X2Jhc2U2NHVybA";
56
+ sub: "ESB00112233";
57
+ aud: "host:node-operator-es";
49
58
  vp: {
50
59
  '@context': "https://www.w3.org/2018/credentials/v1"[];
51
60
  type: "VerifiablePresentation"[];
52
- holder: "did:web:controller.example.org";
61
+ holder: "urn:ietf:params:oauth:jwk-thumbprint:sha-256:Q0ZfM0V4YW1wbGVUaHVtYnByaW50X2Jhc2U2NHVybA";
53
62
  verifiableCredential: string[];
54
63
  };
55
64
  }>;
@@ -1,67 +1,77 @@
1
1
  // Copyright 2026 Antifraud Services Inc. under the Apache License, Version 2.0.
2
2
  // Always create JSDoc, do not use strings inline in keys nor values, use types instead, and reuse the data test examples.
3
3
  import { ActivationCredentialTypes, W3cCredentialContexts, W3cCredentialTypes, } from '../constants/verifiable-credentials.js';
4
+ import { UrnPrefixes } from '../constants/urn.js';
4
5
  /**
5
6
  * Shared synthetic ICA activation-proof fixtures reused by docs/tests.
6
7
  *
7
8
  * Contract note:
8
- * - issuer/holder/audience DIDs, VC subtype names, and representative binding
9
- * fields must be imported from this module instead of re-hardcoded inline
9
+ * - controller-signing/audience ids and VC subtype names must be imported from
10
+ * this module instead of re-hardcoded
11
+ * inline
10
12
  * - the representative `hasCredential.material` shape below reflects the
11
13
  * current `activation-policy` helper contract; if ICA finalizes a different
12
14
  * VC shape, update this module first and then the dependent helpers/tests
15
+ *
16
+ * Modeling note:
17
+ * - this onboarding example intentionally anchors the business subject on the
18
+ * organization tax ID rather than on a pre-existing provider DID
19
+ * - the VP envelope uses a synthetic RFC 7638-style JWK-thumbprint urn and a
20
+ * host id, which better matches the initial registration stage than a
21
+ * synthetic did:web
22
+ */
23
+ /**
24
+ * Synthetic JWK-thumbprint-based signing key id for the organization
25
+ * controller who signs the initial legal-onboarding VP.
13
26
  */
14
- export const EXAMPLE_ICA_VP_ISSUER_DID = 'did:web:controller.example.org';
15
- export const EXAMPLE_ICA_VP_AUDIENCE_DID = 'did:web:host.example.com';
16
- export const EXAMPLE_ICA_VP_HOLDER_DID = EXAMPLE_ICA_VP_ISSUER_DID;
17
- export const EXAMPLE_ICA_ORGANIZATION_DID = 'did:web:org.example.org';
18
- export const EXAMPLE_ICA_REPRESENTATIVE_DID = 'did:web:rep.example.org';
19
- export const EXAMPLE_ICA_ORGANIZATION_TAX_ID = 'ESB00112233';
20
- export const EXAMPLE_ICA_REPRESENTATIVE_ROLE_CODE = 'RESPRSN';
21
- export const EXAMPLE_ICA_REPRESENTATIVE_BINDING_MATERIAL = 'controller-sig-kid';
22
- export const EXAMPLE_ICA_ORGANIZATION_CREDENTIAL = Object.freeze({
27
+ export const EXAMPLE_ORG_CONTROLLER_SIGNING_KEY_ID = `${UrnPrefixes.JwkThumbprintSha256KeyId}Q0ZfM0V4YW1wbGVUaHVtYnByaW50X2Jhc2U2NHVybA`;
28
+ export const EXAMPLE_PRESENTATION_AUDIENCE_HOST_ID = 'host:node-operator-es';
29
+ export const EXAMPLE_ORGANIZATION_TAX_ID = 'ESB00112233';
30
+ export const EXAMPLE_REPRESENTATIVE_ROLE_CODE = 'RESPRSN';
31
+ export const EXAMPLE_ORGANIZATION_ID = EXAMPLE_ORGANIZATION_TAX_ID;
32
+ export const EXAMPLE_ORG_ACTIVATION_ORGANIZATION_CREDENTIAL = Object.freeze({
23
33
  '@context': [W3cCredentialContexts.V2, 'https://schema.org'],
24
34
  type: [
25
35
  W3cCredentialTypes.VerifiableCredential,
26
36
  ActivationCredentialTypes.OrganizationCredential,
27
37
  ],
28
38
  credentialSubject: {
29
- id: EXAMPLE_ICA_ORGANIZATION_DID,
30
- taxID: EXAMPLE_ICA_ORGANIZATION_TAX_ID,
39
+ id: EXAMPLE_ORGANIZATION_ID,
40
+ taxID: EXAMPLE_ORGANIZATION_TAX_ID,
31
41
  },
32
42
  });
33
- export const EXAMPLE_ICA_LEGAL_REPRESENTATIVE_CREDENTIAL = Object.freeze({
43
+ export const EXAMPLE_ORG_ACTIVATION_LEGAL_REPRESENTATIVE_CREDENTIAL = Object.freeze({
34
44
  '@context': [W3cCredentialContexts.V2, 'https://schema.org'],
35
45
  type: [
36
46
  W3cCredentialTypes.VerifiableCredential,
37
47
  ActivationCredentialTypes.LegalRepresentativeCredential,
38
48
  ],
39
49
  credentialSubject: {
40
- id: EXAMPLE_ICA_REPRESENTATIVE_DID,
50
+ id: EXAMPLE_ORG_CONTROLLER_SIGNING_KEY_ID,
41
51
  memberOf: {
42
- taxID: EXAMPLE_ICA_ORGANIZATION_TAX_ID,
52
+ taxID: EXAMPLE_ORGANIZATION_TAX_ID,
43
53
  },
44
54
  hasOccupation: {
45
55
  identifier: {
46
- value: EXAMPLE_ICA_REPRESENTATIVE_ROLE_CODE,
56
+ value: EXAMPLE_REPRESENTATIVE_ROLE_CODE,
47
57
  },
48
58
  },
49
59
  hasCredential: {
50
- material: EXAMPLE_ICA_REPRESENTATIVE_BINDING_MATERIAL,
60
+ material: EXAMPLE_ORG_CONTROLLER_SIGNING_KEY_ID,
51
61
  },
52
62
  },
53
63
  });
54
- export const EXAMPLE_ICA_ACTIVATION_VP_PAYLOAD = Object.freeze({
55
- iss: EXAMPLE_ICA_VP_ISSUER_DID,
56
- sub: EXAMPLE_ICA_VP_ISSUER_DID,
57
- aud: EXAMPLE_ICA_VP_AUDIENCE_DID,
64
+ export const EXAMPLE_ORG_ACTIVATION_PROOF_VP_PAYLOAD = Object.freeze({
65
+ iss: EXAMPLE_ORG_CONTROLLER_SIGNING_KEY_ID,
66
+ sub: EXAMPLE_ORGANIZATION_TAX_ID,
67
+ aud: EXAMPLE_PRESENTATION_AUDIENCE_HOST_ID,
58
68
  vp: {
59
69
  '@context': [W3cCredentialContexts.V1],
60
70
  type: [W3cCredentialTypes.VerifiablePresentation],
61
- holder: EXAMPLE_ICA_VP_HOLDER_DID,
71
+ holder: EXAMPLE_ORG_CONTROLLER_SIGNING_KEY_ID,
62
72
  verifiableCredential: [
63
- JSON.stringify(EXAMPLE_ICA_ORGANIZATION_CREDENTIAL),
64
- JSON.stringify(EXAMPLE_ICA_LEGAL_REPRESENTATIVE_CREDENTIAL),
73
+ JSON.stringify(EXAMPLE_ORG_ACTIVATION_ORGANIZATION_CREDENTIAL),
74
+ JSON.stringify(EXAMPLE_ORG_ACTIVATION_LEGAL_REPRESENTATIVE_CREDENTIAL),
65
75
  ],
66
76
  },
67
77
  });
@@ -59,7 +59,15 @@ export interface ClassicPublicJwk {
59
59
  x: string;
60
60
  y: string;
61
61
  kid?: string;
62
- alg?: string;
62
+ /**
63
+ * JOSE signing algorithm for classical EC keys.
64
+ *
65
+ * Examples:
66
+ * - `ES256` for P-256
67
+ * - `ES384` for P-384
68
+ * - `ES256K` for secp256k1
69
+ */
70
+ alg?: "ES256" | "ES384" | "ES256K";
63
71
  use?: string;
64
72
  }
65
73
  /**
@@ -1,5 +1,13 @@
1
+ import { JoseSignatureAlgorithm } from '../constants/cryptography';
2
+ /**
3
+ * Protected JOSE header used when assembling a compact VP JWT.
4
+ *
5
+ * The `alg` field is intentionally typed as a shared JOSE signature algorithm
6
+ * instead of a free-form string so docs/tests can show the supported values
7
+ * explicitly, including `ES256K` for secp256k1-based signers.
8
+ */
1
9
  export type VpTokenHeader = {
2
- alg: string;
10
+ alg: JoseSignatureAlgorithm;
3
11
  typ?: string;
4
12
  kid?: string;
5
13
  [key: string]: unknown;
@@ -112,5 +120,20 @@ export declare function prepareForSignature(header: VpTokenHeader, payload: VpTo
112
120
  encodedPayload: string;
113
121
  signingInput: string;
114
122
  };
123
+ /**
124
+ * Returns the UTF-8 bytes of the canonical `base64url(header).base64url(payload)`
125
+ * signing input.
126
+ *
127
+ * This is the exact byte sequence an external wallet, HSM, or KMS must sign
128
+ * before the caller assembles the final compact VP JWT with
129
+ * `buildVpTokenCompact(...)`.
130
+ */
115
131
  export declare function prepareBytesForSignature(header: VpTokenHeader, payload: VpTokenPayload): Uint8Array;
132
+ /**
133
+ * Assembles the final compact VP JWT once the caller already has:
134
+ *
135
+ * - the base64url-encoded protected header
136
+ * - the base64url-encoded VP payload
137
+ * - the detached signature returned by the external signer, also base64url-encoded
138
+ */
116
139
  export declare function buildVpTokenCompact(encodedHeader: string, encodedPayload: string, signatureBase64Url: string): string;
@@ -232,10 +232,25 @@ export function prepareForSignature(header, payload) {
232
232
  signingInput: `${encodedHeader}.${encodedPayload}`,
233
233
  };
234
234
  }
235
+ /**
236
+ * Returns the UTF-8 bytes of the canonical `base64url(header).base64url(payload)`
237
+ * signing input.
238
+ *
239
+ * This is the exact byte sequence an external wallet, HSM, or KMS must sign
240
+ * before the caller assembles the final compact VP JWT with
241
+ * `buildVpTokenCompact(...)`.
242
+ */
235
243
  export function prepareBytesForSignature(header, payload) {
236
244
  const { signingInput } = prepareForSignature(header, payload);
237
245
  return new TextEncoder().encode(signingInput);
238
246
  }
247
+ /**
248
+ * Assembles the final compact VP JWT once the caller already has:
249
+ *
250
+ * - the base64url-encoded protected header
251
+ * - the base64url-encoded VP payload
252
+ * - the detached signature returned by the external signer, also base64url-encoded
253
+ */
239
254
  export function buildVpTokenCompact(encodedHeader, encodedPayload, signatureBase64Url) {
240
255
  return `${encodedHeader}.${encodedPayload}.${String(signatureBase64Url || '').trim()}`;
241
256
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "gdc-common-utils-ts",
3
- "version": "1.10.0",
3
+ "version": "1.11.0",
4
4
  "publishConfig": {
5
5
  "access": "public"
6
6
  },