2.0.0 • Published 5 years ago

zxp-sign-cmd v2.0.0

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

zxp-sign-cmd

A JS wrapper for Adobe's extension signer - ZXPSignCmd

Dependencies Build Status Build status Coverage Status MIT licensed

About

zxp-sign-cmd provides a simple interface for Adobe's extension signer. zxp-sign-cmd takes care of starting the requires processes, handling errors, and building the output directory if required.

Installation

    npm i zxp-sign-cmd -D

Usage

const zxpSignCmd = require('zxp-sign-cmd');

There are functions for all 3 operations: sign, selfSignedCert, and verify. Each function takes an options object as its first parameter. See the property tables for the appropriate function below. zxp-sign-cmd's latest API uses promises and async functions. If you require a callback-style implementation, please revert to the legacy v1.x.x API. The result will be a string and will contain the stdout provided by ZXPSignCmd (if the task succeeds). In the event that the task fails, an error is thrown. If you would like to use the await-style implementation, it is recommended to wrap a try/catch and handle errors that way. However, the API does support .then( ) and .catch( ) configurations.

sign

Options

PropertyRequiredDatatypePurpose
inputyesStringThe directory that will be compiled into the packaged zxp file
outputyesStringThe path and filename that the zxp will be exported to
certyesStringThe path and filename of the .p12 certificate that will be used to sign the extension
passwordyesStringThe password associated with the certificate
timestampnoStringURL for a timestamp server

Example:

const signResult = await zxpSignCmd.sign(options);

selfSignedCert

Options

PropertyRequiredDatatypePurpose
countryyesStringThe country associated with the certificate
provinceyesStringThe state or province associated with the certificate
orgyesStringThe organization associated with the certificate
nameyesStringThe commonName for the certificate
passwordyesStringThe password for the certificate
outputyesStringThe path that the certificate will be exported to
localitynoStringThe locality for the certificate
orgUnitnoStringName of the organizational unit
emailnoStringAn email associated with the certificate
validityDaysnoNumberThe number of days the certificate is valid

Example:

const certResult = await zxpSignCmd.selfSignedCert(options);

verify

Options

PropertyRequiredDatatypePurpose
inputyesStringThe path to the zxp file that will be validated
infonoBooleanAllows the result to return a more verbose output of the validation
skipChecksnoBooleanThe validation will skip onlin revocation checks
addCertsnoStringAdditional certificates to validate against

Example:

const verifyResult = await zxpSignCmd.verify(options);

Notes

  • Code coverage is low because the ZXPSignCmd cannot run in the Travis-CI environment. I imagine this is due to an OS compatiblity issue. If you would like to run see more complete code coverage, pull the repo and execute "npm run test".

  • As of v2.0.0, zxp-sign-cmd uses the latest version as defined by the zxp-provider API.