@dinamonetworks/hsm-dinamo

中文文档
4.30.0发布于 2026/10/20ISCTypeScriptES Module零依赖近 30 天下载 6193

Dinamo Client NodeJS to use with DINAMO's HSMs.

原始使用文档
文档目录8 节
  1. APIs
  2. Installation
  3. Settings
  4. Use
  5. Connection Pool
  6. Examples
  7. Release Notes
  8. HSM Documentation

HSM - Hardware Secure Module

The goal of this package is to provide a secure, consistent, and scalable communication layer between applications using NodeJS technology and the HSMs (Hardware Cryptographic Module) manufactured by DINAMO. This layer provides primitive cryptographic functions (signature, encryption) as well as functions from the HSM's specialized modules: Blockchain, XML signing for NFe (electronic invoice), SPB (Brazilian Payment System), and EFT (Electronic Funds Transfer).

APIs

Details of the package's APIs are available in the Javascript HSM API Documentation.

Installation

npm i @dinamonetworks/hsm-dinamo

For APIs that operate functions with smart cards, a complete installation of the HSM software is required, along with the Remote option, as well as a certified USB reader and compatible cards.

Settings

Information about logging configuration is available on the Documentation Setup Page.

Use

// Imports Dinamo HSM APIs
const { hsm } = require("@dinamonetworks/hsm-dinamo");

// Defines the connection parameters to the HSM.
const options = {
  host: "127.0.0.1",
  authUsernamePassword: {
    username: "master",
    password: "12345678",
  },
};

// You can also connect using environment variables:
// HSM_HOST - HSM IP Address
// HSM_PORT - HSM Port (tcp 4433)
// HSM_USERNAME - HSM user name
// HSM_PASSWORD - HSM user password credential

async function hsmConnect() {
  // Connect to HSM
  const conn = await hsm.connect(options);

  // Connection established
  console.log("HSM connected");

  // Disconnect from HSM
  await conn.disconnect();
}

// Execute the hsmConnect function.
hsmConnect();

Connection Pool

For scenarios with multiple concurrent operations, use connectPooled() instead of connect(). It manages a pool of HSM sessions automatically, enabling parallel cryptographic operations without serializing on a single connection. See the Session Pool documentation for details and configuration.

Examples

Several examples using the package's APIs can be found on the Examples Page in the documentation.

Release Notes

Information regarding software versions is available in the Release Notes Page.

HSM Documentation

The complete technical documentation for the HSM (configuration, administration, integration etc) can be found in the HSM Documentation.

版本与发布记录

@dinamonetworks/hsm-dinamo 共发布 121 个版本,首次发布于 2023/09/14;过去 12 个月发布了 8 个版本。

版本发布日期距今
4.30.0latest2026/10/2022 天前
4.29.02026/09/092 个月前
4.28.02026/09/032 个月前
4.27.02026/08/152 个月前
4.26.02026/06/055 个月前
4.25.02026/05/205 个月前

关于 @dinamonetworks/hsm-dinamo 的常见问题

@dinamonetworks/hsm-dinamo 是什么?

Dinamo Client NodeJS to use with DINAMO's HSMs.

如何安装 @dinamonetworks/hsm-dinamo?

在项目目录运行 npm install @dinamonetworks/hsm-dinamo,或使用 pnpm add / yarn add / bun add。

@dinamonetworks/hsm-dinamo 支持 TypeScript 吗?

支持。包内自带 TypeScript 类型声明(package.json 声明了 types 入口),安装后即可获得类型提示,无需再安装 @types 包。

@dinamonetworks/hsm-dinamo 支持 ESM 还是 CommonJS?

以 ES Module 形式发布,推荐使用 import 引入。在 CommonJS 项目中,Node.js 20.19+ / 22.12+ 可以直接 require() 不含顶层 await 的 ES Module,更早的版本需要改用动态 import()。

@dinamonetworks/hsm-dinamo 可以商用吗?

@dinamonetworks/hsm-dinamo 使用 ISC 许可。宽松许可:允许商业使用、修改和再分发,通常只需在分发时保留原版权与许可声明。以上为概括,不构成法律意见,请以许可原文为准。

@dinamonetworks/hsm-dinamo 的下载量有多少?

根据 npm 官方下载统计,@dinamonetworks/hsm-dinamo 在 2026/10/13 – 2026/11/11 这 30 天内被下载 6,193 次,日均约 206 次。下载量会把 CI 构建、镜像同步和作为其他包依赖的安装一并计入,适合横向比较热度,不能直接等同于使用人数。

@dinamonetworks/hsm-dinamo 还在维护吗?

最新版本 4.30.0 发布于 2026/10/20(22 天前);至今共发布 121 个版本,其中过去 12 个月发布了 8 个;首次发布于 2023/09/14。发布频率只是参考信号:功能稳定的工具可能很少需要更新,建议结合源码仓库的 issue 和提交记录判断。