@canton-network/core-signing-securosys

中文文档
0.5.4发布于 2026/11/06Apache-2.0TypeScriptESM + CJS近 30 天下载 1991

Wallet Gateway signing driver for Securosys TSB

原始使用文档
文档目录10 节
  1. Features
  2. Usage
  3. Configuration
  4. Wallet Gateway config
  5. Wallet Gateway environment variables
  6. Key identifiers
  7. Local wallet deployment
  8. Process management
  9. Build and test
  10. References

@canton-network/core-signing-securosys

Signing driver for integrating the Canton Wallet Gateway with Securosys TSB.

Features

  • createKey creates a TSB SKA key with a hardcoded empty policy, then renames it to a label derived from the public key.
  • getKeys enumerates TSB keys and returns Wallet Gateway-compatible public keys.
  • signTransaction creates a TSB sign request and returns the TSB request ID as the provider txId. See Key identifiers for how the signing key is resolved.
  • getTransaction maps TSB request status/result into Wallet Gateway transaction status/signature fields.
  • getTransactions fetches by provider transaction IDs. Public-key-only filtering is supported from this driver's in-memory transaction cache.
  • Runtime configuration can be inspected and changed through getConfiguration / setConfiguration.

Usage

import SecurosysSigningDriver from '@canton-network/core-signing-securosys'

const driver = new SecurosysSigningDriver({
    baseUrl: 'http://localhost:8080',
    keyManagementApiKey: process.env.TSB_KEY_MANAGEMENT_API_KEY,
    keyOperationApiKey: process.env.TSB_KEY_OPERATION_API_KEY,
    mtlsP12Path: process.env.TSB_MTLS_P12_PATH,
    mtlsP12Password: process.env.TSB_MTLS_P12_PASSWORD,
})

The TSB endpoints used by the driver are:

  • GET /v1/key
  • POST /v1/key
  • POST /v1/key/attributes
  • PATCH /v1/key/changeAttributes
  • POST /v1/sign
  • GET /v1/request/{id}
  • POST /v1/filteredRequests
  • DELETE /v1/request/{id}

Configuration

PropertyDescription
baseUrlBase URL of the TSB service.
keyManagementApiKeyX-API-KEY value for /v1/key endpoints.
keyOperationApiKeyX-API-KEY value for signing/request-status endpoints.
bearerTokenOptional bearer access token for access-token mode.
mtlsP12PathOptional path to a PKCS#12/P12 client certificate used when TSB requires mTLS.
mtlsP12PasswordOptional password for the PKCS#12/P12 client certificate.
keyPasswordOptional TSB key password used for key attributes and signing.
signatureAlgorithmTSB signature algorithm. Defaults to EDDSA; current Wallet Gateway/Canton signing expects Ed25519-compatible signatures.

When these values are changed through the Wallet Gateway configuration RPC, use the existing PascalCase convention: MtlsP12Path and MtlsP12Password. MtlsP12Password is masked in getConfiguration.

Wallet Gateway config

Gateway config fieldDriver property
signingProviders.securosys.baseUrlbaseUrl
signingProviders.securosys.mtlsP12PathmtlsP12Path
signingProviders.securosys.signatureAlgorithmsignatureAlgorithm
signingProviders.securosys.keyManagementApiKeyEnvkeyManagementApiKey
signingProviders.securosys.keyOperationApiKeyEnvkeyOperationApiKey
signingProviders.securosys.bearerTokenEnvbearerToken
signingProviders.securosys.mtlsP12PasswordEnvmtlsP12Password
signingProviders.securosys.keyPasswordEnvkeyPassword

The *Env fields store only the environment variable name. Secret values stay in the environment. Defaults match the variable names below.

Wallet Gateway environment variables

Environment variableDriver propertyUsage
SECUROSYS_TSB_BASE_URLbaseUrlLegacy discovery only; ignored when signingProviders is configured
SECUROSYS_TSB_KEY_MANAGEMENT_API_KEYkeyManagementApiKeyDefault name for the key-management API key; override with keyManagementApiKeyEnv
SECUROSYS_TSB_KEY_OPERATION_API_KEYkeyOperationApiKeyDefault name for the key-operation API key; override with keyOperationApiKeyEnv
SECUROSYS_TSB_BEARER_TOKENbearerTokenDefault name for the bearer token; override with bearerTokenEnv
SECUROSYS_TSB_MTLS_P12_PATHmtlsP12PathLegacy discovery only; ignored when signingProviders is configured
SECUROSYS_TSB_MTLS_P12_PASSWORDmtlsP12PasswordDefault name for the PKCS#12/P12 password; override with mtlsP12PasswordEnv
SECUROSYS_TSB_KEY_PASSWORDkeyPasswordDefault name for the TSB key password; override with keyPasswordEnv
SECUROSYS_TSB_SIGNATURE_ALGORITHMsignatureAlgorithmLegacy discovery only; ignored when signingProviders is configured

Every key created by this driver is first sent to TSB with a temporary wallet-{uuid} label. After TSB returns the public key, the driver renames the key through PATCH /v1/key/changeAttributes to a deterministic label derived from the normalized public key. The label uses base64url form so it is safe for TSB key-name handling and avoids collisions between users or networks that reuse the same party hint.

Key identifiers

signTransaction accepts the standard signing keyIdentifier:

  • When keyIdentifier.id is supplied, it is used unchanged as the TSB key label.
  • When only keyIdentifier.publicKey is supplied, the driver derives the label with keyLabelFromPublicKey and looks the key up by that label. This is the form the Wallet Gateway sends, and it matches the label given to keys created by this driver.

In both cases a supplied publicKey is kept, and signing fails if the TSB key found for the label has a different public key. As a result, a direct driver call with only a public key looks up the derived label and does not scan all TSB keys. Keys that were not created by this driver, and so do not carry the derived label, must be addressed by an explicit id.

Every key is created with the same empty SKA policy:

{
    "ruleUse": null,
    "ruleBlock": null,
    "ruleUnblock": null,
    "ruleModify": null,
    "keyStatus": {
        "blocked": false
    }
}

For EdDSA signatures, the driver validates and returns the Wallet Gateway-compatible format: base64-encoded raw 64-byte Ed25519 signature bytes. The TSB request payload type is hardcoded to UNSPECIFIED, the signature type is hardcoded to RAW, and TSB Ed25519 DER/SPKI public keys are always converted to the 32-byte raw key expected by the wallet signing API. Simple ASN.1 OCTET STRING / BIT STRING wrappers and DER R,S sequences are still converted as a compatibility guard before returning the signature.

Local wallet deployment

Run the wallet monorepo commands from the wallet repository root:

cd /path/to/wallet

See docs/CONTRIBUTING.md for development environment setup.

Download the Playwright browsers required by the wallet browser tests:

pnpm playwright:install

Download the Canton binary used by the local devnet setup:

pnpm script:fetch:canton

Start local Canton on the devnet configuration:

pnpm start:canton --network=devnet

Wait until the Canton bootstrap completes. The command can then be interrupted with Ctrl+C; the Canton process keeps running under PM2.

Configure signingProviders.securosys in wallet-gateway/test/config.json, for example:

{
    "signingProviders": {
        "securosys": {
            "baseUrl": "https://integration-test.cloudshsm.com/",
            "mtlsP12Path": "./etc/client_mtls_tsb.p12"
        }
    }
}

Then start the full wallet stack with the remaining mTLS secret:

SECUROSYS_TSB_MTLS_P12_PASSWORD=pass \
pnpm start:all

For bearer-token authentication, set signingProviders.securosys.baseUrl to the appropriate endpoint and start with the token:

SECUROSYS_TSB_BEARER_TOKEN="<JWT Token>" \
pnpm start:all

Open the Wallet Gateway UI:

open http://localhost:3030

Check gateway health and readiness:

curl -i http://localhost:3030/healthz
curl -i http://localhost:3030/readyz

Process management

List all PM2-managed wallet processes:

pnpm pm2 list

Inspect the remote Wallet Gateway logs:

pnpm pm2 logs remote

Inspect the Canton logs:

pnpm pm2 logs canton

Restart only the remote Wallet Gateway backend:

pnpm pm2 restart remote

Stop all PM2-managed wallet processes:

pnpm stop:all

Fully kill the PM2 daemon and all managed processes:

pnpm pm2 kill

Build and test

Build only this signing driver:

pnpm workspace @canton-network/core-signing-securosys build

Run only this signing driver's tests:

pnpm nx test @canton-network/core-signing-securosys

Run this signing driver's tests with coverage:

pnpm nx test @canton-network/core-signing-securosys -c coverage

Build the remote Wallet Gateway:

pnpm workspace @canton-network/wallet-gateway-remote build

Run the remote Wallet Gateway transaction-signing tests:

pnpm nx test @canton-network/wallet-gateway-remote -- src/ledger/transaction-service.test.ts

Run the wallet allocation tests:

pnpm nx test @canton-network/wallet-gateway-remote -- src/ledger/wallet-allocation/wallet-allocation-service.test.ts

Run the shared signing-library tests:

pnpm nx test @canton-network/core-signing-lib

Build the full wallet monorepo serially:

pnpm build:all:serial

Run the full wallet monorepo test suite:

pnpm test:all

References

版本与发布记录

@canton-network/core-signing-securosys 共发布 12 个版本,首次发布于 2026/08/10;过去 12 个月发布了 12 个版本。

版本发布日期距今
0.5.4latest2026/11/063 天前
0.5.32026/10/2911 天前
0.4.1-backport.3bugfix2026/10/2614 天前
0.5.22026/10/2317 天前
0.5.12026/10/1228 天前
0.4.1-backport.12026/10/031 个月前

关于 @canton-network/core-signing-securosys 的常见问题

@canton-network/core-signing-securosys 是什么?

Wallet Gateway signing driver for Securosys TSB

如何安装 @canton-network/core-signing-securosys?

在项目目录运行 npm install @canton-network/core-signing-securosys,或使用 pnpm add / yarn add / bun add。

@canton-network/core-signing-securosys 支持 TypeScript 吗?

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

@canton-network/core-signing-securosys 支持 ESM 还是 CommonJS?

同时提供 ES Module 与 CommonJS 入口,import 和 require() 都可以使用,打包工具会自动选择合适的版本。

@canton-network/core-signing-securosys 可以商用吗?

@canton-network/core-signing-securosys 使用 Apache-2.0 许可。宽松许可:允许商业使用、修改和再分发,并附带明确的专利授权;分发时需保留许可与 NOTICE 文件,修改过的文件要注明改动。以上为概括,不构成法律意见,请以许可原文为准。

@canton-network/core-signing-securosys 的下载量有多少?

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

@canton-network/core-signing-securosys 还在维护吗?

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