singme
TypeScript icon, indicating that this package has built-in type declarations

0.0.1 • Public • Published

signme

Library for work with sign.me service to sign files.

How to install

npm package

For install npm-package use npm i signme or yarn add signme.

in browser

Just download file (singme.js or signme.min.js) from this page and insert the tag in your html:

<script src="signme.js"></script>
...
<script>
  const SignMe = signme.default
  ...
</script>

How to use

Sign files use browser:

import SignMe from "signme";

const signme = new SignMe({ apiKey: "<api key>" });

const filesToSign = [
  {
    filet: Buffer.from("Hello").toString("base64"),
    fname: "hello.html",
  },
];

const uuid = await signme.sendFiles(filesToSign);
// open link in browser for confirm signing:
// https://server_name/signapi/multijson/<uuid>

or without browser:

import SignMe from "signme";

const signme = new SignMe({
  apiKey: "<api key>",
  userPhone: "<phone>",
  password: "<password>",
});

const filesToSign = [
  {
    filet: Buffer.from("Hello").toString("base64"),
    fname: "hello.html",
  },
];

const uuid = await signme.sendFiles(filesToSign);

await signme.sign(uuid);

Get link to signature file:

import md5 from "md5";

const response = await signme.check(md5("Hello"));
const downloadLink = response.signature_1.pkcs7;

Build from source

Download from github, install dependencies:

$ git clone git@github.com:scientistnik/signme.git
$ cd signme
$ yarn

build package:

$ yarn build

If you need build for browser:

$ yarn browserify

To start tests, you need to create .env-file (see .env-template example) where set your API-key.

Run tests:

$ yarn test

Contributing

Bug reports and pull requests are welcome on GitHub.

License

The package is available as open source under the terms of the MIT License.

Readme

Keywords

none

Package Sidebar

Install

npm i singme

Weekly Downloads

0

Version

0.0.1

License

MIT

Unpacked Size

8.64 kB

Total Files

8

Last publish

Collaborators

  • scientistnik