Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Release/0.1.1 #8

Closed
wants to merge 10 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
51 changes: 1 addition & 50 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,64 +1,15 @@
# Editor settings
.vscode

# Logs
logs
*.log
npm-debug.log*
yarn-debug.log*
yarn-error.log*

# Runtime data
pids
*.pid
*.seed
*.pid.lock

# Directory for instrumented libs generated by jscoverage/JSCover
lib-cov

# Coverage directory used by tools like istanbul
coverage
.coveralls.yml

# nyc test coverage
.nyc_output

# Grunt intermediate storage (http://gruntjs.com/creating-plugins#storing-task-files)
.grunt

# Bower dependency directory (https://bower.io/)
bower_components

# node-waf configuration
.lock-wscript

# Compiled binary addons (https://nodejs.org/api/addons.html)
build/Release

# Dependency directories
node_modules/
jspm_packages/

# TypeScript v1 declaration files
typings/

# Optional npm cache directory
.npm

# Optional eslint cache
.eslintcache

# Optional REPL history
.node_repl_history

# Output of 'npm pack'
*.tgz

# Yarn Integrity file
.yarn-integrity

# dotenv environment variables file
.env

# next.js build output
.next
6 changes: 6 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,3 +11,9 @@ notifications:
email:
on_success: change
on_failure: change

jobs:
include:
- stage: Produce Coverage
node_js: node
script: jest --coverage && cat ./coverage/lcov.info | ./node_modules/coveralls/bin/coveralls.js && rm -rf ./coverage
14 changes: 8 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
# node-signpdf

[![npm package](https://nodei.co/npm/node-signpdf.png?downloads=true&downloadRank=true&stars=true)](https://nodei.co/npm/node-signpdf/)

[![npm version](https://badge.fury.io/js/node-signpdf.svg)](https://badge.fury.io/js/node-signpdf)
[![Build Status](https://travis-ci.com/vbuch/node-signpdf.svg?branch=master)](https://travis-ci.com/vbuch/node-signpdf)
[![Coverage Status](https://coveralls.io/repos/github/vbuch/node-signpdf/badge.svg?branch=master)](https://coveralls.io/github/vbuch/node-signpdf?branch=master)

Simple signing of PDFs in node.

Expand Down Expand Up @@ -34,8 +34,8 @@ And call `.sign()`
import signer from 'node-signpdf';

const signedPdf = signer.sign(
fs.readFileSync(PATH_TO_P12_CERTIFICATE),
fs.readFileSync(PATH_TO_PDF_FILE)
fs.readFileSync(PATH_TO_P12_CERTIFICATE),
);
```

Expand All @@ -45,8 +45,10 @@ In practice we expect that most people will just read through the code we've wri

* The process of signing a document is described in the [Digital Signatures in PDF](https://www.adobe.com/devnet-docs/acrobatetk/tools/DigSig/Acrobat_DigitalSignatures_in_PDF.pdf) document.
* This lib:
* requires the [signature placeholder](#append-a-signature-placeholder) to already be in the document. Takes `Buffer`s of the PDF and a P12 certificate to use when [signing](#generate-and-apply-signature)
* does not cover multiple signatures, incremental updates, etc. Only the basic scenario of signing a freshly created PDF. We actually only worked with documents created with PDFKit.
* requires the [signature placeholder](#append-a-signature-placeholder) to already be in the document;
* requires the `Contents` descriptor in the `Sig` be placed after the `ByteRange` one;
* takes `Buffer`s of the PDF and a P12 certificate to use when [signing](#generate-and-apply-signature);
* does not cover multiple signatures, incremental updates, etc. Only the basic scenario of signing a freshly created PDF. We actually only worked with documents created with PDFKit;
* Feel free to copy and paste any part of this code. See its defined [Purpose](#purpose).

## Signing PDF in simple steps
Expand Down Expand Up @@ -79,6 +81,6 @@ That's where `node-signpdf` kicks in. Given a PDF and a P12 certificate a signat

## Contributing

* All PRs are welcome.
* All PRs are welcome in the `develop` branch.
* This is a git-flow repo. We use the default git flow with a `v` version prefix.
* Note that [gitmoji](https://gitmoji.carloscuesta.me/) is used in the commit messages. That's not a must but we think it's nice.
42 changes: 41 additions & 1 deletion package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

17 changes: 16 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "node-signpdf",
"version": "0.1.0",
"version": "0.1.1",
"description": "Simple signing of PDFs in node.",
"repository": {
"type": "git",
Expand Down Expand Up @@ -39,6 +39,20 @@
"dist"
]
},
"contributors": [
{
"name": "vbuch",
"url": "https://github.com/vbuch"
},
{
"name": "maldimirov",
"url": "https://github.com/maldimirov"
},
{
"name": "alekssakovsky",
"url": "https://github.com/alekssakovsky"
}
],
"dependencies": {
"node-forge": "^0.7.6"
},
Expand All @@ -50,6 +64,7 @@
"babel-plugin-module-resolver": "^3.1.1",
"babel-plugin-syntax-object-rest-spread": "^6.13.0",
"babel-preset-env": "^1.7.0",
"coveralls": "^3.0.2",
"eslint": "^4.19.1",
"eslint-config-airbnb-base": "^12.1.0",
"eslint-import-resolver-babel-module": "^4.0.0",
Expand Down