0.0.2 • Published 5 years ago

@crpt/cades-utils v0.0.2

Weekly downloads
18
License
MIT
Repository
github
Last release
5 years ago

cades-Utils

Travis npm package Coveralls

CADES Utils already contains cadesplugin_api.js in own bundle.

Usage

import { CadesUtils as anyName } from "@crpt/cades-utils";
//or
import CadesUtils from "@crpt/cades-utils";
//usually you will need 2 methods

CadesUtils.getFinalCertsArray().then(certs => {
  console.log("certs", certs);
  CadesUtils.signMessage("lalala", certs[0].certificate).then(signed =>
    console.log("signed", signed);
  );
});
methoddescription
getFinalCertsArray(): Promise<Cert[]>Init plugin, create store, . Cert: {certificate: {}, info: [] }, certificate is an original cadesplugin Certificate object, info is an array name, date_from, date_to, serial_number.
signMessage(message, cert, detached): PromiseSign message with selected certificate.