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

@sertainty-eng/sertainty-sdk

v1.0.1

Published

Sertainty NodeJS SDK

Readme

Sertainty SDK

Sertainty logo

Sertainty SDK helps to protect and encrypt your data and share secure manner. It allows desired parties to access the data if they are authenticated from a challenge verification process.

How to run the code

Step 1: Get the Sertainty license

You need to have the latest Sertainty Tools and the Sertainty license for running this tutorial.

Please contact us through [email protected]

Step 2: Get the code

  • Clone this repository with git clone https://github.com/sertainty/Sertainty-Wrappers.git

  • or Download the Zip

Step 3: Configure development environment

We reference necessary files from Sertainty Tools.

Set the install location of the Seratainty Tools using SERTAINTY_HOME system environmental variable.

setx SERTANITY_HOME /M "%ProgramFiles%\Sertainty"

Step 4: Install dependencies

  1. You need to have Node JS and npm installed in your PC.

  2. We use node-gyp for buiding necessary addons:

    • install Python 2.x.x
    • npm install -g node-gyp
    • npm install -g --production windows-build-tools

Step 5: Run the code

  1. cd Sertainty-Wrappers/NodeJS/examples

  2. npm install

  3. npm start

  4. Use these to answer the security questions you get in the sample program.

    Username: [email protected]

    Challenge 1: Response 1

    Challenge 2: Response 2

    Challenge 3: Response 3

    ...........

    Challenge 10: Response 10

Walkthrough

In this example we are using Sertainty Technology to generate digital id and protect data using that id. We also demonstrate how to access protected data with authentication process.

Initialize sertainty

You need to initialize sertainty sdk with valid licenseFile and appKey before using it.

const bufferHandle = core.uxpba_newHandle();

const licenseFile = "sertainty.lic";
const appKey = "SertaintyONE";
const logPrefix = "sertainty-tutorial";
const logVersion = "1.0";
const args = [];

const status = core.uxpsys_initLibrary(bufferHandle, args.length, args, licenceFile, appKey, logPrefix, logVersion);

/* make sure if Sertainty initialized correctly */

if (status == 0) {
  const errHandle = core.uxpba_getData(bufferHandle);
  const errText = ref.readCString(errHandle);
  console.error(`Error initializing the Environment: ${errText}`);
} 

console.log("Sertainty initialized successfully");

Generate an ID file

See the sampleid.xml file in the examples directory. Open this and go through it. It contains application related data and challenge questions and answers.

This is private for each user of the Sertainty SDK. You need this file to generate an digital id(.iic) for each user.

/* XML id file generated from the sertainty application */
const idXmlSpec = "sampleid.xml";
const idFileSpec = "sampleid.iic";

const callStausHandle = core.uxpsys_newCallStatusHandle();
core.uxpsys_fileReadAll(callStausHandle, idXmlSpec, bufferHandle);

/* check errors in last `uxpsys_fileReadAll` function call */
if (core.uxpsys_hasError(callStausHandle)) {
  const errHandle = core.uxpsys_getErrorMessage(callStausHandle);
  const errText = ref.readCString(errHandle);
  console.error(`Reading ${idXmlSpec}`);
  
} else {
  /* Generate ID file */
  
  console.log(`Read ${idXmlSpec}: done`);
  const dataHandle = core.uxpba_getData(buffer);
  const doc = ref.readCString(dataHandle);
  core.uxpid_publishToFile(callStatusHandle, idFileSpec, doc, 1);
  
  if (core.uxpsys_hasError(callStatusHandle)) {
      const errHandle = core.uxpsys_getErrorMessage(callStatusHandle);
      const errText = ref.readCString(errHandle);
      console.error(`Error creating ID file: ${errText}`);
  }
  
  console.log("${idFileSpec} created");
}

Generate UXP and protect data

We'll create a file with .uxp extension that can encapsulate data in encrypted mode. This function requires two main inputs,

  • Data(to be encrypted)
  • ID(.iic) file

Generate UXP file

/* a file to be encrypted */
const dataPdfSpec = "data.pdf";
/* output file name */
const uxpFileSpec = "sample.uxp";


const appHandle = core.uxpfile_newHandle();
core.uxpfile_openNewFile(appHandle, uxpFileSpec, idFileSpec, 3, 1, 0);

if (core.uxpsys_hasError(appHandle)) {
  const errHandle = core.uxpsys_getErrorMessage(appHandle);
  const errText = ref.readCString(errMsgPtr);
  console.log("Error opening file ${errText}");
  
} else {
  console.log("${uxpFileSpec} created");
}

Protect data

core.uxpfile_addVirtualFromFile(appHandle, "data.pdf", dataPdfSpec, -1, -1, 8);
  
if (core.uxpsys_hasError(appHandle)) {
    const errHandle = core.uxpsys_getErrorMessage(appHandle);
    const errText = ref.readCString(errHandle);
    console.error("Error creating virtual file: ${errText}");
}

console.log("File has been Encrypted");

Access protected data

You need to pass the authorization before accessing the data. Application will provide randomize challenge questions based on the ID(.iic) file and user need to answer them within limited time.

core.uxpfile_openFile(appHandle, uxpFileSpec, Mode.ReadOnly);

let done = false;
let authorized = false;
let status = null;

while (!done) {
// get authentication status
status = core.uxpfile_authenticate(appHandle);

    switch (status) {
        case AUTHORIZATION_STATUS.Authorized: {
            console.log("You're authorized");
            done = true;
            authorized = true;
            break;
        }

        case AUTHORIZATION_STATUS.NotAuthorized: {
            console.log("You're not authorized");
            authorized = false;
            done = true;
            break;
        }

        case AUTHORIZATION_STATUS.Challenged: {
            // get remaining challange count
            const challangeCount = core.uxpfile_getChallengeCount(appHandle);
            for (let i = 0; i < challangeCount; i++) {
                const challangePtr = core.uxpfile_getChallenge(appHandle,i);
                // print the challange question and wait for the user response and save the response
                getResponse(challangePtr);
                core.uxpfile_addResponse(appHandle, challangePtr);
                core.uxpch_freeHandle(challangePtr);
            }
          break;
        }

        default: {
            console.log("Invalid authorization status");
            break;
        }
    }
}

Files

We use different files to run this examples. We'll see what they are.

  • sampleid.xml - This file used to generate sampleid.iic. Contains random challenge question and answers.
  • sampleid.iic - Act as a digital id for the user of this application. Can be shared with other parties.
  • sample.uxp - Uxp files are protected data. In order to protect data for intended recipiant you need the recipient's id(.iic) file and the data to be protected.