Git Product home page Git Product logo

origami's Introduction

Origami

Overview

This is a fork of the original origami project.

I have added a way to sign PDF files with an external provider, such as the Austrian "Handy-Signatur" (Mobile Phone Signature)

Currently only PDF PKCS#7 signatures are supported, however I plan to support PAdES (PDF Advanced Electronic Signatures) as well.

Requirements

You can review requirements and other important information at the original origami project.

Quickstart

This fork adds two new methods for PDF manipulating.

base64_string = pdf.prepare_signature(
      name: "John Doe",
      location: "Somewhere",
      contact: "[email protected]",
      reason: "PDF Signature Test",
      method: Signature::PKCS7_DETACHED,
      content_size: 4096)

prepare_signature adds the signature object to the PDF document and prepares it for signing. You can specify some parameters which are shown when opening the PDF with a PDF reader (name, location, etc). This method returns the PDF as a Base64 encoded string, excluding the signature placeholder.

insert_signature(signature_base64)

This method inserts the signature back into the PDF (at the /Content object).

Code example here.

Flow

  1. Read or create PDF document
  2. Prepare the signature
  3. Send Base64 content to external signature provider
  4. Insert the signature into the PDF
  5. Finish

Known Bugs

When saving the PDF after preparing it and re-reading it from disk, the Signature Object can get scrambled up, which invalidates the ByteRange array and also the signature.

Helpful Literature

Digital Signatures in a PDF

Portable Document Format Reference Manual Version 1.3

License

Origami is distributed under the LGPL license.

Copyright © 2017 Guillaume Delugré.

origami's People

Contributors

moritzgloeckl avatar bellps avatar lcreid avatar

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.