gdc-sdk-node-ts 2.4.16 → 2.4.18

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.
@@ -221,7 +221,10 @@ export class NodeManagedWallet {
221
221
  }
222
222
  const privateJwk = entry.privateMaterial;
223
223
  const keyObject = createPrivateKey({ key: privateJwk, format: 'jwk' });
224
- const signature = cryptoSign(this.resolveNodeDigestForAlgorithm(alg), Buffer.from(payloadBytes), keyObject);
224
+ // JWS uses the fixed-width IEEE P1363 ECDSA representation (R || S).
225
+ // Node defaults to ASN.1 DER, which produces a syntactically valid compact
226
+ // token that every JOSE verifier correctly rejects.
227
+ const signature = cryptoSign(this.resolveNodeDigestForAlgorithm(alg), Buffer.from(payloadBytes), { key: keyObject, dsaEncoding: 'ieee-p1363' });
225
228
  return Buffer.from(signature).toString('base64url');
226
229
  }
227
230
  /**
@@ -237,7 +240,7 @@ export class NodeManagedWallet {
237
240
  return this.cryptography.verifyBytes(Content.base64ToBytes(signature), payloadBytes, jwk);
238
241
  }
239
242
  const publicKey = createPublicKey({ key: jwk, format: 'jwk' });
240
- return cryptoVerify(this.resolveNodeDigestForAlgorithm(algorithm), Buffer.from(payloadBytes), publicKey, Buffer.from(signature, 'base64url'));
243
+ return cryptoVerify(this.resolveNodeDigestForAlgorithm(algorithm), Buffer.from(payloadBytes), { key: publicKey, dsaEncoding: 'ieee-p1363' }, Buffer.from(signature, 'base64url'));
241
244
  }
242
245
  /**
243
246
  * Encrypts one payload for the provided recipient public JWK.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "gdc-sdk-node-ts",
3
- "version": "2.4.16",
3
+ "version": "2.4.18",
4
4
  "description": "Next-generation Node runtime package for the GDC SDK family",
5
5
  "license": "Apache-2.0",
6
6
  "author": "Antifraud Services Inc.",
@@ -38,7 +38,7 @@
38
38
  "test:e2e:live-gw:clean": "bash ./scripts/run-live-gw-clean.sh"
39
39
  },
40
40
  "dependencies": {
41
- "gdc-common-utils-ts": "2.5.12",
41
+ "gdc-common-utils-ts": "2.5.15",
42
42
  "gdc-sdk-core-ts": "~2.3.18"
43
43
  },
44
44
  "devDependencies": {