npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

@smartdcc/duis-sign-wrap

v0.4.3

Published

Wrapper library for signing/validating DUIS

Readme

GitHub banner

DUIS Signing Wrapper

License: GPL v3 Tests codecov GitHub version

Lightweight TypeScript wrapper around SmartDCCInnovation/dccboxed-signing-tool - which is a tool for signing and validating DUIS messages. This package wraps dccboxed-signing-tool as a JavaScript package with some additional marshalling and error handling. That is, it provides an API to create and validate an appropriately formatted xmldsig.

Table of Contents

Usage

Important: This package wraps around a JAR file, thus it is essential that a Java Runtime Environment is installed and available in the PATH before using it. Please use JRE 11 (or newer).

From Debian/Ubuntu an appropriate JRE can be installed with:

sudo apt install openjdk-11-jre

Developed and tested against node 24. Install from npm:

npm i @smartdcc/duis-sign-wrap

Sign DUIS

Below is a minimal example of how to use the library:

import { signDuis } from '@smartdcc/duis-sign-wrap'
import { readFile } from 'node:fs/promises'

const duisSigned: string = await signDuis({ xml: await readFile('/path/to/duis/file-without-signature.xml') })

Providing no exception was raised, the resulting duisSigned should be compatible with DCC Boxed.

Validate

Then to validate a signed DUIS against its XSD and remove the digital signature:

import { validateDuis } from '@smartdcc/duis-sign-wrap'

const xml: string = await validateDuis({ xml: duisSigned })

HTTP Backend

The library supports using an HTTP backend server for signing and validation, which provides increased performance for multiple operations by reusing the same Java process.

import { signDuis, validateDuis } from '@smartdcc/duis-sign-wrap'

// Automatically start and manage a local backend server
const signed = await signDuis({ xml: '<duis/>', backend: true })
const validated = await validateDuis({ xml: signed, backend: true })

Alternatively, a custom backend server can be provided that conforms to the correct API. This is useful when needing to integrate with a bespoke key store. The HTTP API is documented within the SmartDCCInnovation/dccboxed-signing-tool tool.

// Or use a custom backend URL
const customSigned = await signDuis({
  xml: '<duis/>',
  backend: new URL('http://signing-service.example.com/'),
  headers: { 'Authorization': 'Bearer token' }
})

Advanced

The intention is that this tool is compatible with the duis-parser to obtain a JSON representation of the DUIS. A minimal example without error handling would be:

import { validateDuis } from '@smartdcc/duis-sign-wrap'
import { parseDuis } from '@smartdcc/duis-parser'

const data = parseDuis(await validateDuis({ xml: duisSigned }))

API Options

Both signDuis and validateDuis accept an options object with the following properties:

  • xml (string | Buffer, required): The DUIS XML content to sign or validate
  • backend (boolean | URL, optional): Use HTTP backend for improved performance
    • true: Automatically start and manage a local backend server
    • URL: Use a custom backend server at the specified URL
  • headers (Record<string, string>, optional): Custom HTTP headers when using backend mode
  • preserveCounter (boolean, optional, sign only): Preserve counter value in RequestID when signing

Error Handling

import { signDuis } from '@smartdcc/duis-sign-wrap'

try {
  const signed = await signDuis({ xml: '<invalid/>', backend: true })
} catch (error) {
  console.error('Signing failed:', error.message)
  // Handle validation errors, missing credentials, etc.
}

Contributing

Contributions are welcome!

Remember, when developing it is required to install a JDK (to build the dccboxed-signing-tool) and update submodules. To build the JAR file, run the following command: npm run build:jar.

When submitting a pull request, please ensure:

  1. Each PR is concise and provides only one feature/bug fix.
  2. Unit test are provided to cover feature. The project uses jest. To test, run npm run test:cov to view code coverage metrics.
  3. Bugfixes are reference the GitHub issue.
  4. If appropriate, update documentation.
  5. Before committing, run npm run lint and npm run prettier-check.

If you are planning a new non-trivial feature, please first raise a GitHub issue to discuss it to before investing your time to avoid disappointment.

Any contributions will be expected to be licensable under GPLv3.

Other Info

Copyright 2026, Smart DCC Limited, All rights reserved. Project is licensed under GPLv3.