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 🙏

© 2025 – Pkg Stats / Ryan Hefner

@universis/signer-worker

v1.6.0

Published

Universis signer worker for server applications

Readme

@universis/signer-worker

Universis signer worker for server applications

Getting started

Install @universis/signer-worker

npm i @universis/signer-worker

Important note: Verify that Universis Signer is already installed as a service. Follow installation instructions to install and configure Universis Signer.

Configuration

Configure Universis api server to use SignerWorker service. Register @universis/signer-worker#SignerWorker under universis api server services section of application configuration:

{
    "services": [
        {
            "serviceType": "@universis/signer-worker#SignerWorker"
        }
    ]
}

or configure Universis api server to use SignerService service.

{
    "services": [
        {
            "serviceType": "@universis/signer-worker#SignerService"
        }
    ]
}

Sign documents

SignerService.signFile(context: DataContext, file: string, contentType?: string, options?: { timestampServer?: string, position?: string, reason?: string })

SignerService.signFile can be used for signing *.pdf files using a server instance of Universis Signer

For completing sign process, the signer service instance should be configured by adding settings/universis/signerService section at application configuration


{
  "settings": {
    "universis": {
      "signerService": {
        "user": "user",
        "password": "password",
        "host": "http://localhost:2465"
      }
    }
  }
}

where host is the URL of the Universis Signer service, user and password are the credentials for the Universis Signer service.

Normally, the Universis Signer service which is running on http://localhost:2465, uses a PKCS12 store with secret key and certificate for signing. In this case, the user and password are used to access the PKCS12 store. SignerService service will try to get valid certificates, and select the first one that is valid for signing. Use the configuration setting thumbnail if you want to explicitly define the certificate that should be used for signing.

{
  "settings": {
    "universis": {
      "signerService": {
        "user": "user",
        "password": "password",
        "host": "http://localhost:2465",
        "thumbnail": "2d49be3b03db5d176482640549d5aaede84c925d"
      }
    }
  }
}

Sign data

SignerService.sign(context: DataContext, data: unknown, options?: { timestampServer?: string, reason?: string })

SignerService.sign method can be used for signing data. The data can be any JSON-serializable object, and the method will return a signed version of the data.

The options parameter can include a timestampServer URL for timestamping the signature, a position string to specify the position of the signature in the document, and a reason string to specify the reason for signing.

Example

import {SignerService} from '@universis/signer-worker';

function signJson(context: DataContext, data: unknown) {
    const signerService = context.getApplication().getService(SignerService);
    return signerService.sign(context, data, {
        timestampServer: "http://timestamp.server.com",
        reason: "Signing example data"
    });
}

signJson(context, { message: "Hello, World!" })
    .then(signedData => {
        console.log("Signed data:", signedData);
    })
    .catch(error => {
        console.error("Error signing data:", error);
    });

Remote Signer Worker

To use the remote signer worker, you need to configure the Universis API server to use the RemoteSignerWorker service. This service will communicate with the Universis Signer service running on a remote server. Register @universis/signer-worker#RemoteSignerWorker under universis api server services section of application configuration:

{
  "services": [
    {
      "serviceType": "@universis/signer-worker#RemoteSignerWorker"
    }
  ]
}

This will allow the Universis API server to use the remote signer worker for signing operations. The remote signer worker will handle the communication with the Universis Signer service and perform the signing operations as needed.

The remote signer service host should be configured in the application settings:

{
  "settings": {
    "universis": {
      "remoteSignerWorker": {
        "host": "http://remote-signer-server:8480"
      }
    }
  }
}

Where host is the URL of the remote Universis Signer service.

Remote signer worker will expose the same methods under /services/remoteSigner as the local signer worker, allowing you to sign files and data in the same way as described above.