node-signpdf | Simple signing of PDFs in node | Runtime Evironment library

 by   vbuch JavaScript Version: 3.0.0 License: MIT

kandi X-RAY | node-signpdf Summary

kandi X-RAY | node-signpdf Summary

node-signpdf is a JavaScript library typically used in Server, Runtime Evironment, Nodejs applications. node-signpdf has no bugs, it has no vulnerabilities, it has a Permissive License and it has low support. You can install using 'npm i node-signpdf' or download it from GitHub, npm.

Simple signing of PDFs in node.
Support
    Quality
      Security
        License
          Reuse

            kandi-support Support

              node-signpdf has a low active ecosystem.
              It has 493 star(s) with 155 fork(s). There are 18 watchers for this library.
              OutlinedDot
              It had no major release in the last 12 months.
              There are 15 open issues and 118 have been closed. On average issues are closed in 152 days. There are no pull requests.
              It has a neutral sentiment in the developer community.
              The latest version of node-signpdf is 3.0.0

            kandi-Quality Quality

              node-signpdf has 0 bugs and 0 code smells.

            kandi-Security Security

              node-signpdf has no vulnerabilities reported, and its dependent libraries have no vulnerabilities reported.
              node-signpdf code analysis shows 0 unresolved vulnerabilities.
              There are 0 security hotspots that need review.

            kandi-License License

              node-signpdf is licensed under the MIT License. This license is Permissive.
              Permissive licenses have the least restrictions, and you can use them in most projects.

            kandi-Reuse Reuse

              node-signpdf releases are not available. You will need to build from source code and install.
              Deployable package is available in npm.
              Installation instructions are not available. Examples and code snippets are available.

            Top functions reviewed by kandi - BETA

            kandi has reviewed node-signpdf and discovered the below as its top functions. This is intended to give you an instant insight into node-signpdf implemented functionality, and help decide if they suit your requirements.
            • Get a page ref reference
            • Extract pages from a page
            • interpolate default module
            Get all kandi verified functions for this library.

            node-signpdf Key Features

            No Key Features are available at this moment for node-signpdf.

            node-signpdf Examples and Code Snippets

            No Code Snippets are available at this moment for node-signpdf.

            Community Discussions

            QUESTION

            how to digitally sign a PDF document with a certificat using Javascript?
            Asked 2022-Mar-27 at 19:41

            i was looking for a solution to digitally sign a pdf with a self-signed certificat and came across a video in youtube explaining the process using pdf-lib and node-signpdf libraries. However, after following the instructions it didnt work as intended and encountered a problem:

            • i executed the command ( npm i ) and (npm start ) as shown in the github repo of the project.

            repo : https://github.com/RichardBray/pdf_sign

            Demo ( 8 mins video ) : https://www.youtube.com/watch?v=OFZK5lc70OI&list=PLXUfmx2SIgyICZP-rA84Sle_ghq30W89N&index=4&t=1s

            ...

            ANSWER

            Answered 2022-Mar-27 at 19:41

            it appears that the problem is OS related. In fact , the code works fine under linux OS but have some issues with Windows OS related to import command. For windows OS replacing "import" commands with "require" commands solves the problem.

            BEFORE:

            Source https://stackoverflow.com/questions/71617826

            QUESTION

            "Unexpected byte range values defining scope of signed data" when signing a pdf
            Asked 2020-Nov-16 at 14:56

            I use a modified version of this library: https://github.com/vbuch/node-signpdf#readme in an angular app to sign a pdf with a signature that has been created elsewhere. When I open the signed pdf with foxit reader the signature is invalid with the following message:

            Unexpected byte range values defining scope of signed data

            Any ideas what the problem could be?

            Here is the file: https://drive.google.com/file/d/1eS2waysotpAx6VtHMNvhGvl3wqgiyoT7/view?usp=sharing

            ...

            ANSWER

            Answered 2020-Nov-16 at 14:56
            First Example Document

            I couldn't reproduce the “Unexpected byte range values defining scope of signed data” error message with the first example document, Foxit "merely" complained that the signature was invalid. Which it indeed is because you forgot to base64-decode the signature string before injecting it into the PDF - PDF requires the embedded signature containers in DER format.

            Second Example Document

            The second example document was shared in a comment:

            Now I don't get the error about the byte range anymore but I get new errors: "The document has been altered or corrupted since the Signature was applied." and "The Signer's identity is invalid because it has expired or is not yet valid." and "The signature includes an embedded timestamp but it could not be verified." Not sure if I'm doing it correctly now. This is the new file: https://drive.google.com/file/d/1vsa7thwCsi04r68cdcIsfJG7cT2__-d9/view?usp=sharing

            Indeed, the signature container now is injected in DER format, so Foxit Reader can validate it. Concerning the new error messages:

            "The document has been altered or corrupted since the Signature was applied." - this indicates here that there is some digest value mismatch.

            Calculating and extracting the digest values in question shows that the SHA256 digest value of the signed byte ranges of the document is

            Source https://stackoverflow.com/questions/64802512

            QUESTION

            Digital signature not visible in Adobe reader but visible in Foxit reader
            Asked 2020-Nov-03 at 17:57

            I'm using this library https://github.com/vbuch/node-signpdf to sign a pdf document. After I have signed the document I can see the signature when I open the pdf with Foxit reader but not when I open it with Adobe reader DC. I also tried Adobe reader XI but there I can't see it either. When I open the document in pdf xchange viewer I get this error: non critical errors detected in the xref table.

            Any ideas what the problem could be?

            That's the file I signed: https://drive.google.com/file/d/1AZvS4sP2Y3FwW4Deod87Dgxc9I0QZkoc/view?usp=sharing

            ...

            ANSWER

            Answered 2020-Nov-03 at 17:57

            In your example PDF the name of the signature field consists of 10 bytes, 9 bytes with value 0x00 and one byte with value 0x01. Apparently Adobe Reader does not like that field name.

            After some experiments it looks like Adobe Reader does not like a field name starting with a 0x00 byte.

            Maybe it contains some code that determines string lengths in a c'ish manner and interprets a 0x00 as end-of-string. A field name with a leading 0x00 byte, therefore, is interpreted as empty string, a field name not accepted by Adobe Reader either.

            Thus, please use a signature field name made of (in particular starting with) some meaningful characters. As validators usually display the name of the signature field, this is a good idea anyways.

            In terms of lowlevel PDF objects:

            The signature field object looks like this:

            Source https://stackoverflow.com/questions/64647990

            QUESTION

            Sign PDF in a modern browser natively?
            Asked 2020-Jun-29 at 08:51
            What I'm trying to achieve
            • Sign a PDF in the browser using cliets certificate store or Smart Card
            What I did so far
            1. For accessing the local cert store I use FortifyApp.
            2. Pdf is pre-signed on the server using iText(Sharp), then sent to the client via Ajax. Relevant code:
            ...

            ANSWER

            Answered 2020-Jun-29 at 08:51

            So I figured it out.

            Can I achieve my goal without having to manually upload a p12/pfx file, is it even possible?

            Yes, it is. (See below on what needs to be changed.)

            Is the server-side implementation of the deferred signature correct, do I need something else?

            Yes, the code above is fine.

            Is the pdf manipulation in javascript correct?

            Also fine.

            Can I transform the native CrytpoKey to forge or pkijs?

            Yes, see below.

            What is wrong with the last signature?

            @mkl answered it in a comment, thank you.

            FortifyApp has a CMS demo now. Although it didn't work with the version I was using, it works with version 1.3.4.

            So I went with the pki.js implementation. The code changes need for the signing to be successful are the following:

            1. Export the certificate:

            Source https://stackoverflow.com/questions/62472562

            Community Discussions, Code Snippets contain sources that include Stack Exchange Network

            Vulnerabilities

            No vulnerabilities reported

            Install node-signpdf

            You can install using 'npm i node-signpdf' or download it from GitHub, npm.

            Support

            For any new features, suggestions and bugs create an issue on GitHub. If you have any questions check and ask questions on community page Stack Overflow .
            Find more information at:

            Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items

            Find more libraries