PDFSignature | Example on how to add a signature to a PDF using PDFKit | Document Editor library

 by   rajeejones Swift Version: Current License: No License

kandi X-RAY | PDFSignature Summary

kandi X-RAY | PDFSignature Summary

PDFSignature is a Swift library typically used in Editor, Document Editor applications. PDFSignature has no bugs, it has no vulnerabilities and it has low support. You can download it from GitHub.

Example on how to add a signature to a PDF using PDFKit in Swift.
Support
    Quality
      Security
        License
          Reuse

            kandi-support Support

              PDFSignature has a low active ecosystem.
              It has 29 star(s) with 9 fork(s). There are 3 watchers for this library.
              OutlinedDot
              It had no major release in the last 6 months.
              There are 2 open issues and 1 have been closed. There are no pull requests.
              It has a neutral sentiment in the developer community.
              The latest version of PDFSignature is current.

            kandi-Quality Quality

              PDFSignature has no bugs reported.

            kandi-Security Security

              PDFSignature has no vulnerabilities reported, and its dependent libraries have no vulnerabilities reported.

            kandi-License License

              PDFSignature does not have a standard license declared.
              Check the repository for any license declaration and review the terms closely.
              OutlinedDot
              Without a license, all rights are reserved, and you cannot use the library in your applications.

            kandi-Reuse Reuse

              PDFSignature releases are not available. You will need to build from source code and install.

            Top functions reviewed by kandi - BETA

            kandi's functional review helps you automatically verify the functionalities of the libraries and avoid rework.
            Currently covering the most popular Java, JavaScript and Python libraries. See a Sample of PDFSignature
            Get all kandi verified functions for this library.

            PDFSignature Key Features

            No Key Features are available at this moment for PDFSignature.

            PDFSignature Examples and Code Snippets

            No Code Snippets are available at this moment for PDFSignature.

            Community Discussions

            QUESTION

            PAdES Signature Level - Adobe Acrobat
            Asked 2021-May-05 at 13:17

            I am creating a PADES signature using pdfbox 3.0.0 RC, my code works using the example to create the digital signature. However, I am unable to see the signature level in Adobe Acrobat when I open the document with this tool although it is able to validate my signature.

            I am not creating the VRI so I am guessing that this might be an issue but then if this is necessary to validate my signature I don't understand why the signature is displayed as valid?

            Adobe Acrobat Signature:

            ...

            ANSWER

            Answered 2021-May-05 at 13:17

            While analyzing the file document-with signingTime.pdf you provided in a comment, I recognized an issue in it. Being aware of that issue I re-checked your original document-17 21.08.14.pdf and also recognized that issue therein, so maybe this issue causes the validation problem you're here to solve. Thus, ...

            Both your example files (document-17 21.08.14.pdf and document-with signingTime.pdf) contain each actually two concatenated copies of the same, multi-revision PDF with a single signature Signature1, merely the second copy has a changed ID entry. Added to them are incremental updates with a signature Signature2.

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

            QUESTION

            Attach digital signature to pdf using mssp
            Asked 2020-Nov-11 at 04:15

            I am trying to sign pdf document digitally and need to attach signature to signature panel using MSSP(mobile signature service provider). I researched some stackoverflow questions and i did things as below.

            First i create checksum of pdf. Before generate the checksum add empty signature to pdf. After i generated the checksum i send that as data to sign document to the server. The server gives to me base64 signature and i found certificate chain from base64 signature. Now i need to attach signature to the pdf, show to the "Signature Panel" section of Adobe reader.

            I extract certificate chain from base64 signature and i dont know how to attach this to pdf.

            My code is :

            this function does create empty signature to pdf.

            ...

            ANSWER

            Answered 2020-Nov-09 at 10:23

            The code in the question is based on a multi-phase approach:

            • Sign the PDF injecting an empty byte array as signature container (by use of the ExternalBlankSignatureContainer).
            • Calculate the digest to sign (here incorrectly a digest for the whole file from the previous step is calculated, the digest must be calculated for the whole file except the signature container placeholder).
            • Request signature container for that document hash.
            • Inject signature container into the placeholder in the file from the first step.

            If the signature server can take a long time to return a signature container, such an approach is appropriate but in the case at hand comments clarify

            The server gives response quickly(just few seconds)

            In such a use case one should proceed in a single step approach (as far as iText signing API calls are concerned):

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

            QUESTION

            Integrate Signed Hash into original PDF
            Asked 2020-Jul-14 at 13:42

            I am integrating a signed hash in an original PDF, and I still have an error on the validity of the signature. it's say that a pdf has been changed after signing.

            below the steps: I calculate the hash then I send it for signature and finally I get the hash sign and I proceed to the integration in the original pdf

            ...

            ANSWER

            Answered 2020-Jul-10 at 15:24

            Your signDocument method apparently does not accept a pre-calculated hash value but seems to calculate the hash of the data you give it, in your case the (lower case) hex presentation of the hash value you already calculated.

            In your first example document you have these values (all hashes are SHA256 hashes):

            • Hash of the byte ranges to sign:

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

            QUESTION

            multiple signing pdf iText
            Asked 2020-Jun-17 at 08:58

            im trying to sign a document several times simulating a signature by different users using itext 5.5.13.1, PdfStamper is on AppendMode. If document has not signatures, the certification level is CERTIFIED_NO_CHANGES_ALLOWED or CERTIFIED_FORM_FILLING_AND_ANNOTATIONS, else i dont set this param for PdfSignatureAppearence. After the second signing the first signature is invalid, because the document was changed. Any ideas how to fix this? Here's my code:

            ...

            ANSWER

            Answered 2020-Jun-17 at 08:58
            The Change

            The most important part of your screenshot

            is the text "1 Page(s) Modified" between the signatures on the signature panel. This tells us that you do other changes than merely adding and filling signature fields. Inspecting the file itself one quickly recognizes the change:

            • In the original sample.pdf

              there is just a single content stream.

            • In sample_signed.pdf with one signature

              there are three content streams, the original one enveloped by the new ones.

            • In sample_signed_signed.pdf with two signatures

              there are five content streams, the former three enveloped by two new ones.

            So in each signing pass you change the page content. As you can read in this answer, changes to the page content of signed documents are always disallowed. It doesn't even help that the contents of the added streams are trivial, each stream added in front contains:

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

            QUESTION

            Sign PDF with signature hash provided by api
            Asked 2020-May-26 at 09:11

            I am trying to sign a pdf with PDFBox and a third-party signature provider.

            My procedure:
            1. Getting the pdf from user input
            2. Creating a PDDocument with the content of the given pdf
            3. creating a PDSignature with all given properties such as organisation or location but without the signature-hash itself.
            4. adding this signature object to the PDDocument and creating a digest from the PDDocument to send to the API.
            5. Awaiting a successful answer from the API (containing the signature hash) and inserting this hash into the PDDocuments PDSignature object without altering the whole document.
            My problem:

            I can create the PDDocument, the PDSignature and the digest of it and send it to the API. I then get the correct and valid signature hash back from the API and I can add it to the PDDocument but whenever this works, the resulting pdf has an invalid signature due to "being altered or manipulated"(the signer, timestamp and certificate are valid). I also tried to use the ExternalSigningSupport from PDFBox but I cannot use it as I always run into an error:

            ...

            ANSWER

            Answered 2020-May-26 at 09:11

            QUESTION

            IText: cannot set СryptoDictionary property of PdfSignatureAppearance
            Asked 2020-May-26 at 04:53

            There was a code using iTextSharp:

            ...

            ANSWER

            Answered 2020-May-26 at 04:53

            The iText 7 signing API attempts to hide implementation details which shouldn't be used anymore since the 5.3.x signature API overhaul, and the signature dictionary is such a detail.

            For details on the signature API introduced in the 5.3.x versions, please read the iText Digital Signatures white paper. The Java examples in there have been ported to C# and can be accessed here.

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

            QUESTION

            How to insert .p7s byte array into PDF with iText7?
            Asked 2020-May-16 at 08:39

            I am trying to insert a .p7s byte array info to signature field, I follow this image below:

            My steps:

            Prepare Signature Container

            the original PDF is "tmp/example.pdf" and the output of this part is "results/prepared.pdf"

            ...

            ANSWER

            Answered 2020-May-16 at 08:39

            First of all, you do not have to split the signing process like you do. I've seen a lot of questions in which the developers want to do this, but strictly speaking it is not necessary (well, under the hood iText still will first create a prepared PDF and later inject the signature container, but it can be kept under the hood).

            Splitting the process only is necessary if the external signing service takes very long to create the signature and you cannot keep the PDF in memory for that time.

            I'll look into both variants here.

            Single pass signing

            If your external signing service returns the result (a full PKCS#7 signature container) fast enough, you should use this approach. The base code starts similar to yours:

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

            QUESTION

            Signed pdf missing timestamp from timestamp server
            Asked 2020-Feb-11 at 09:39

            I try to digitally sign a pdf using an external web service. This web service contains the user certificate, which the user can access with their credentials and a one time password generated code.

            Sidenote: The web service is supposed to expect the pdf digest (hash), but strangely it accepts the whole file instead.

            Anyway the implementation is as follows:

            ...

            ANSWER

            Answered 2020-Feb-11 at 09:39

            Since the signature that I receive does not contain a timestamp from a timestamp server, can I embed such a timestamp at this point or should the remote web service add it before sending the signature to me?

            Such a time stamp is added to the signature container as unsigned attribute. Because they are not signed, unsigned attributes in a signature container can be changed after applying a signature, e.g. additional ones can de added.

            Thus, you yourself can in particular add a time stamp to the signature container retrieved from your service.

            Depending on the nature of your signatures, though, you might have to increase the size of the placeholder you create in the pdf to have enough space for the additional time stamp.

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

            QUESTION

            External signing PDF with iText
            Asked 2019-Nov-09 at 11:01

            First of all, although I've been following StackOverflow for quite some time, it is the first time I posted something, so if I do something wrong or not according to the rules, please feel free to point me in the right direction.

            I'm developing a PDF digital signature application, using iText5, which depends on an external service to provide a signed hash after I prepare the PDF for signing.

            As described in iText documentation, in the first phase I prepared the PDF (in the final implementation, all PDFs may be multi signed, so I use append mode), like so:

            ...

            ANSWER

            Answered 2019-Feb-08 at 13:27

            There are a number of issues in your code.

            First of all your code mixes different iText signing API generations. There is the older API generation which requires you to work very near to the PDF internals, and there is the newer (since version 5.3.x) API which is implemented as a layer over the older API and does not require you to know those internals.

            The "Digital Signatures for PDF documents" white paper focuses on showing the newer API, only section 4.3.3 "Signing a document on the server using a signature created on the client" uses the old API because the use case does not allow for the use of the newer API.

            Your use case does allow for the use of the newer API, though, so you should try and use only it.

            (In certain situations one can mix those APIs, but you then should really know what you're doing and still can get it awfully wrong...)

            But now some more specific issues:

            Working on closed objects

            The MakeSignature.Sign* methods implicitly close the underlying PdfStamper and SignatureAppearance objects, so working with those objects thereafter should not be assumed to result in sensible information.

            But in GetBytesToSign you do

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

            QUESTION

            PDF document signing with Google KMS and Entrust certificate
            Asked 2019-Sep-18 at 12:31

            I am trying to make a valid signature in a pdf document by using a certificate from CA (Entrust) generated with a private key from Google KMS (private key never goes out from the KMS). The certificate chain is made as: [entrustCert, intermediate, rootCert]

            Following the part of the code I am using to make this happen:

            ...

            ANSWER

            Answered 2019-Sep-18 at 12:31
            Broken message digest value

            Analysis of file-signed-failed.pdf

            In an ASN.1 dump of the contained signature container one issue immediately strikes the eye: The messageDigest attribute contains a copy of the signed attributes as they should be, i.e. with a proper messageDigest attribute:

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

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

            Vulnerabilities

            No vulnerabilities reported

            Install PDFSignature

            You can download it from GitHub.

            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
            CLONE
          • HTTPS

            https://github.com/rajeejones/PDFSignature.git

          • CLI

            gh repo clone rajeejones/PDFSignature

          • sshUrl

            git@github.com:rajeejones/PDFSignature.git

          • Stay Updated

            Subscribe to our newsletter for trending solutions and developer bootcamps

            Agree to Sign up and Terms & Conditions

            Share this Page

            share link