node-opcua-pki 6.8.0 → 6.8.2

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/dist/index.d.mts CHANGED
@@ -526,6 +526,19 @@ declare class CertificateManager extends EventEmitter {
526
526
  * @param certificate - the DER-encoded certificate
527
527
  */
528
528
  trustCertificate(certificate: Certificate): Promise<void>;
529
+ /**
530
+ * Check whether the trusted certificate store is empty.
531
+ *
532
+ * This inspects the in-memory index, which is kept in
533
+ * sync with the `trusted/certs/` folder by file-system
534
+ * watchers after {@link initialize} has been called.
535
+ */
536
+ isTrustListEmpty(): boolean;
537
+ /**
538
+ * Return the number of certificates currently in the
539
+ * trusted store.
540
+ */
541
+ getTrustedCertificateCount(): number;
529
542
  /** Path to the rejected certificates folder. */
530
543
  get rejectedFolder(): string;
531
544
  /** Path to the trusted certificates folder. */
package/dist/index.d.ts CHANGED
@@ -526,6 +526,19 @@ declare class CertificateManager extends EventEmitter {
526
526
  * @param certificate - the DER-encoded certificate
527
527
  */
528
528
  trustCertificate(certificate: Certificate): Promise<void>;
529
+ /**
530
+ * Check whether the trusted certificate store is empty.
531
+ *
532
+ * This inspects the in-memory index, which is kept in
533
+ * sync with the `trusted/certs/` folder by file-system
534
+ * watchers after {@link initialize} has been called.
535
+ */
536
+ isTrustListEmpty(): boolean;
537
+ /**
538
+ * Return the number of certificates currently in the
539
+ * trusted store.
540
+ */
541
+ getTrustedCertificateCount(): number;
529
542
  /** Path to the rejected certificates folder. */
530
543
  get rejectedFolder(): string;
531
544
  /** Path to the trusted certificates folder. */
package/dist/index.js CHANGED
@@ -1464,6 +1464,23 @@ var CertificateManager = class _CertificateManager extends import_node_events.Ev
1464
1464
  async trustCertificate(certificate) {
1465
1465
  await this.#moveCertificate(certificate, "trusted");
1466
1466
  }
1467
+ /**
1468
+ * Check whether the trusted certificate store is empty.
1469
+ *
1470
+ * This inspects the in-memory index, which is kept in
1471
+ * sync with the `trusted/certs/` folder by file-system
1472
+ * watchers after {@link initialize} has been called.
1473
+ */
1474
+ isTrustListEmpty() {
1475
+ return this.#thumbs.trusted.size === 0;
1476
+ }
1477
+ /**
1478
+ * Return the number of certificates currently in the
1479
+ * trusted store.
1480
+ */
1481
+ getTrustedCertificateCount() {
1482
+ return this.#thumbs.trusted.size;
1483
+ }
1467
1484
  /** Path to the rejected certificates folder. */
1468
1485
  get rejectedFolder() {
1469
1486
  return import_node_path6.default.join(this.rootDir, "rejected");