Git Product home page Git Product logo

zxp-sign-cmd's Introduction

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

Property Required Datatype Purpose
input yes String The directory that will be compiled into the packaged zxp file
output yes String The path and filename that the zxp will be exported to
cert yes String The path and filename of the .p12 certificate that will be used to sign the extension
password yes String The password associated with the certificate
timestamp no String URL for a timestamp server

Example:

const signResult = await zxpSignCmd.sign(options);

selfSignedCert

Options

Property Required Datatype Purpose
country yes String The country associated with the certificate
province yes String The state or province associated with the certificate
org yes String The organization associated with the certificate
name yes String The commonName for the certificate
password yes String The password for the certificate
output yes String The path that the certificate will be exported to
locality no String The locality for the certificate
orgUnit no String Name of the organizational unit
email no String An email associated with the certificate
validityDays no Number The number of days the certificate is valid

Example:

const certResult = await zxpSignCmd.selfSignedCert(options);

verify

Options

Property Required Datatype Purpose
input yes String The path to the zxp file that will be validated
info no Boolean Allows the result to return a more verbose output of the validation
skipChecks no Boolean The validation will skip onlin revocation checks
addCerts no String Additional 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.

zxp-sign-cmd's People

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar

zxp-sign-cmd's Issues

Rename "country" property to "coutryCode"

It is not clear what "country" property under selfSignedCert operation expects. Name suggests it has to be a full name country (Lithuania, Estonia), however, it expects a 2 letter coutryCode. So to avoid further confusion it would be beneficial to rename this property to countryCode instead.

Signing fails on non-existing folder hierarchy

Signing operation fails if "output" destination contains non-existing nested folder hierarchy:

Works: "existingFolder/NonExistingFolder/file.zxp"
Fails: "existingFolder/NonExistingFolder1/NonExistingFolder 2/file.zxp"

Would be great if it recursively create folder hierarchy before placing a ZXP file.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.