Skip to content
This repository has been archived by the owner on May 17, 2022. It is now read-only.

safenetlabs/node-keyziio-agent

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

20 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

node-keyziio-agent

A Node.js interface library for the Keyziio key management and encryption service. Asynchronous methods use promises.

Setting the API Token

kagent.set_token("token");

Checking the API Token

kagent.check()
    .then(function(){
        console.log("Successfully connected to SafeX using API Token")
    })
    .catch(function(e) {
        console.warn("WARNING: Was unable to verify connection to SafeX using the API Token")
    });

Getting User Infomration

kagent.get_user(id)
  .then(function(data){
    // Got the user
  })
  .catch(function(e) {
    // Failed to get the user -- doesn't exist?
  });

Creating a New User

 kagent.create_user(id, friendly_name)
    .then(function(data){
      // User created!
    })
    .catch(function(e){
      // Failed to create user
    });

Testing

Run the make command in the top directory to test. By default it will run the tests against a mock of the keyziio server. To run the tests against the actual keyziio service set the environment variable NOCK_OFF to true.

export NOCK_OFF=true

Server API

The documentation for the keyziio server API is here: http://docs.keyziio.apiary.io/ This API is used both by the keyziio agent and the keyziio crypto library.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published