node-opcua-pki 6.3.0 → 6.5.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.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "node-opcua-pki",
3
- "version": "6.3.0",
3
+ "version": "6.5.0",
4
4
  "description": "PKI management for node-opcua",
5
5
  "type": "commonjs",
6
6
  "main": "./dist/index.js",
@@ -44,10 +44,10 @@
44
44
  "chokidar": "4.0.3",
45
45
  "command-line-args": "^6.0.1",
46
46
  "command-line-usage": "^7.0.3",
47
- "node-opcua-crypto": "5.1.0",
47
+ "node-opcua-crypto": "5.2.0",
48
48
  "progress": "^2.0.3",
49
49
  "wget-improved-2": "^3.3.0",
50
50
  "yauzl": "^3.2.0"
51
51
  },
52
- "gitHead": "b923adbc2c9bb43588035562a28be7ad51b20196"
52
+ "gitHead": "1ca27a313de057145601f25385fd6522dbcf9621"
53
53
  }
package/readme.md CHANGED
@@ -213,13 +213,15 @@ await cm.createSelfSignedCertificate({
213
213
 
214
214
  #### Certificate Trust
215
215
 
216
- | Method | Description |
217
- | -------------------------------------- | ------------------------------------------------------------------------------------------ |
218
- | `trustCertificate(cert)` | Add a certificate to the trusted store |
219
- | `rejectCertificate(cert)` | Move a certificate to the rejected store |
220
- | `getCertificateStatus(cert)` | Returns `"trusted"`, `"rejected"`, or `"unknown"` |
221
- | `removeTrustedCertificate(thumbprint)` | Remove a trusted certificate by SHA-1 thumbprint. Returns the certificate buffer or `null` |
222
- | `verifyCertificate(cert, options?)` | Full certificate chain validation |
216
+ | Method | Description |
217
+ | ----------------------------------------------- | ------------------------------------------------------------------------------------------ |
218
+ | `trustCertificate(cert)` | Add a certificate to the trusted store |
219
+ | `rejectCertificate(cert)` | Move a certificate to the rejected store |
220
+ | `verifyCertificate(cert, options?)` | Full certificate chain validation |
221
+ | `removeTrustedCertificate(thumbprint)` | Remove a trusted certificate by SHA-1 thumbprint. Returns the certificate buffer or `null` |
222
+ | `addTrustedCertificateFromChain(certChain)` | Validate and trust the leaf certificate from a DER chain |
223
+ | `isIssuerInUseByTrustedCertificate(issuerCert)` | Check if any trusted cert was signed by this issuer |
224
+ | `reloadCertificates()` | Force a full re-scan of all PKI folders |
223
225
 
224
226
  #### Issuer (CA) Certificates
225
227
 
@@ -250,6 +252,20 @@ await cm.createSelfSignedCertificate({
250
252
  | `issuersCrlFolder` | `{location}/issuers/crl` |
251
253
  | `rootDir` | `{location}` |
252
254
 
255
+ ### File Watching
256
+
257
+ `CertificateManager` uses [chokidar](https://github.com/paulmillr/chokidar) to watch the PKI folders for changes. By default, it uses **native OS events** (inotify, FSEvents, ReadDirectoryChangesW) for near-real-time detection.
258
+
259
+ If the PKI folders are on a network file system (NFS, CIFS) or inside a Docker volume where native events don't propagate, set the environment variable:
260
+
261
+ ```bash
262
+ OPCUA_PKI_USE_POLLING=true
263
+ ```
264
+
265
+ This falls back to filesystem polling, which is slower but works on all file systems.
266
+
267
+ > **Note:** If external processes modify the PKI folders directly (e.g., CLI tools, OPC UA `WriteTrustList`), call `reloadCertificates()` to force an immediate re-scan of the folder state.
268
+
253
269
  ## References
254
270
 
255
271
  - [OPC Foundation GDS File Store](https://reference.opcfoundation.org/GDS/docs/F.1/)