Skip to content

Commit

Permalink
Merge pull request #2 from bounsel/main
Browse files Browse the repository at this point in the history
Fix EU signature. Thanks marsanla!
  • Loading branch information
zboris12 authored Sep 19, 2023
2 parents 4136451 + e6361df commit d6d6d23
Show file tree
Hide file tree
Showing 4 changed files with 39 additions and 9 deletions.
4 changes: 2 additions & 2 deletions lib/zganode.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
const m_urlparser = require("url");
const m_h = {
"http:": require("http"),
"https:": require("https"),
"http:": require('follow-redirects').http,
"https:": require('follow-redirects').https,
};
const z = require("./zgaindex.js");
z.forge = require("node-forge");
Expand Down
8 changes: 6 additions & 2 deletions lib/zgapdfsigner.js
Original file line number Diff line number Diff line change
Expand Up @@ -782,6 +782,9 @@ z.PdfSigner = class{
if(_this.opt.reason){
signObj["Reason"] = _this.convToPDFString(_this.opt.reason);
}
if(_this.opt.signame){
signObj["Name"] = _this.convToPDFString(_this.opt.signame);
}
if(_this.opt.location){
signObj["Location"] = _this.convToPDFString(_this.opt.location);
}
Expand Down Expand Up @@ -963,11 +966,12 @@ z.PdfSigner = class{
{
"type": forge.pki.oids.contentType,
"value": forge.pki.oids.data,
}, {
"type": forge.pki.oids.messageDigest,
}, {
"type": forge.pki.oids.signingTime,
"value": signdate,
}, {
"type": forge.pki.oids.messageDigest,

},
],
});
Expand Down
30 changes: 28 additions & 2 deletions package-lock.json

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

6 changes: 3 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "zgapdfsigner",
"version": "2.5.0",
"version": "2.5.1",
"author": "zboris12",
"description": "A javascript tool to sign a pdf or set protection to a pdf in web browser, Google Apps Script and nodejs.",
"homepage": "https://github.com/zboris12/zgapdfsigner",
Expand Down Expand Up @@ -32,9 +32,9 @@
"test": "node test4node.js"
},
"dependencies": {
"follow-redirects": "1.15.2",
"pdf-lib": "1.17.1",
"node-forge": "1.3.1"
},
"devDependencies": {
}
"devDependencies": {}
}

0 comments on commit d6d6d23

Please sign in to comment.