node-opcua-crypto-web 5.10.0 → 5.10.1

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.
@@ -1022,7 +1022,8 @@ declare function derToPrivateKey(privDer: ArrayBuffer): Promise<CryptoKey>;
1022
1022
  declare function pemToPrivateKey(pem: string): Promise<CryptoKey>;
1023
1023
 
1024
1024
  interface CreateSelfSignCertificateOptions {
1025
- privateKey: CryptoKey;
1025
+ /** The key that signs the certificate and whose public half it carries — a raw key, or an HSM/KMS-backed {@link CaSigner}. */
1026
+ privateKey: CryptoKey | CaSigner;
1026
1027
  notBefore?: Date;
1027
1028
  notAfter?: Date;
1028
1029
  validity?: number;
package/dist/index_web.js CHANGED
@@ -62315,12 +62315,7 @@ async function createSelfSignedCertificate({
62315
62315
  applicationUri,
62316
62316
  purpose
62317
62317
  }) {
62318
- const crypto4 = getCrypto();
62319
- const publicKey = await buildPublicKey(privateKey);
62320
- const keys = {
62321
- privateKey,
62322
- publicKey
62323
- };
62318
+ const { crypto: crypto4, keys, signingAlgorithm } = await resolveCaKeyPair(privateKey);
62324
62319
  const { nsComment, basicConstraints, keyUsageExtension, usages } = getAttributes(purpose);
62325
62320
  notBefore = notBefore || /* @__PURE__ */ new Date();
62326
62321
  validity = validity || 0;
@@ -62356,7 +62351,9 @@ async function createSelfSignedCertificate({
62356
62351
  name,
62357
62352
  notBefore,
62358
62353
  notAfter,
62359
- signingAlgorithm: { name: "RSASSA-PKCS1-v1_5", hash: { name: "SHA-256" } },
62354
+ // for a raw key resolveCaKeyPair yields exactly the historical
62355
+ // RSASSA-PKCS1-v1_5/SHA-256; for a CaSigner, the signer's declared algorithm
62356
+ signingAlgorithm,
62360
62357
  keys,
62361
62358
  extensions: [
62362
62359
  new x509_es_exports.Extension(ID_NETSCAPE_COMMENT, false, AsnConvert.serialize(AsnUtf8StringConverter.toASN(nsComment))),
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "node-opcua-crypto-web",
3
- "version": "5.10.0",
3
+ "version": "5.10.1",
4
4
  "type": "module",
5
5
  "description": "Pre-bundled, zero-config browser build of node-opcua-crypto",
6
6
  "//why": "This package exists so node-opcua-crypto can stay lean for Node. The pre-bundled browser build inlines its polyfills (crypto-browserify, stream-browserify, ...) and weighs ~344 KB gzip - more than the entire node-opcua-crypto tarball. Shipping it there would make every Node consumer download a browser bundle they never import. Browser consumers install this package explicitly, or let node-opcua-crypto's \"browser\" export condition redirect to it (see node-opcua-crypto/browser/index.js).",
@@ -44,7 +44,7 @@
44
44
  "crypto-browserify": "^3.12.1",
45
45
  "esbuild": "^0.28.2",
46
46
  "events": "^3.3.0",
47
- "node-opcua-crypto": "^5.10.0",
47
+ "node-opcua-crypto": "^5.10.1",
48
48
  "path-browserify": "^1.0.1",
49
49
  "process": "^0.11.10",
50
50
  "stream-browserify": "^3.0.0",
@@ -67,5 +67,5 @@
67
67
  "LICENSE",
68
68
  "README.md"
69
69
  ],
70
- "gitHead": "5ef0e4cd1d4b707dd182305ddfa964959954ecdf"
70
+ "gitHead": "3b38bdb6a674317a98a2f709b66f8339d62e2e38"
71
71
  }