Comments (7)
Hey, I think I have a working prototype! I'm trying to create my own fork, stay tuned.
So my flow looks something like this:
- Read PDF
- Call
prepare_for_sign
method, however I think there's an error in the ByteRange calculation in the old one, mine works a little bit different, return Base64 encoded PDF without the/Content <>
- Have your Website sign the PDF Base64
- Put the Signature in with the
insert_sign
method
I thought it was not signing the whole PDF, but that's not true, it's just that their ByteRange
calculation is wrong. Other than that their fork is working!
I suggest that you read this and this. It really helps understanding the PDF structure. Also looking at the PDF with a HexEditor helped a lot and comparing the Ruby output.
from origami.
Hi!
I'm trying to implement something similar. Take a look at the mobmewireless/origami-pdf fork especially at the prepare_for_sign
method.
My problem currently is that I want to sign the whole document and not just the annotation, which the prepare_for_sign
method does.
Maybe we could collaborate on this?
Thanks
from origami.
Yes, we may try!
I see that a fork is based on an old 1.2 Origami version. Did you try to use it as is or to adopt those changes to the current version?
I am not very familiar with PDF structure for now, but I looked at prepare_for_sign() method and it seems to do the same as sign() method in current Origami except replacing null-terminated signature values with the real one. So it should return not just annotation, bul all contents for signing?
I also noticed that it returns SHA1 hash, while PKCS#7 detached signature is computed not from SHA1, but from raw content, so PKCS#7 detached signatures might be broken there (needs verification).
from origami.
- Did you try to adopt changes to the latest Origami version? I think it should be the best way, because their version is too old and might contain various other bugs. Also if we create a new fork from the current version and adopt their changes - we could then make a pull request and Origami's author might participate in development.
- Did you also compare their's/your's ByteRange calculation with the current mainstream implementation?
- Do you plan to implement support for multiple signatures?
- When do you plan to push some working code to your repo? I would also like to make so experiments...
from origami.
Hi @soulhunter1987 !
- I have successfully implemented my changes into a fork of the newest Origami. You're correct it's very old and it probably had some bugs. Check it out: https://github.com/moritzgloeckl/origami It's working great for me so far, I have put all the important information in the Readme
- I'm now using the updated Origami ByteRange calculation and it's working perfectly
- Currently no because we don't need that use case, however I think it might not be too hard to implement, but I haven't looked into it yet.
- It's live
🎉
from origami.
That's great!
I recently found out that I also need to support PAdES (you also mention it in your README). And also multiple signatures, as I already mentioned. I will try to use your version soon and provide feedback. This will be the big first step forward. Then, I hope we will collaborate to implement remaining features.
from origami.
Let's continue in my fork: moritzgloeckl#1
from origami.
Related Issues (20)
- Does Origami verify a pdf with more than one digital signatures? HOT 1
- Adding a FreeText annotation HOT 1
- encryption doesn't work on some pdf files
- Encoding::UndefinedConversionError: "\xEF" from ASCII-8BIT to UTF-8 HOT 1
- Encrypted PDF in GEM
- Documentation : How to get contents ? HOT 2
- integrate origami toggling into org and markdown visibility cycling?
- Library status HOT 1
- Add watermark and signature to existing pdf HOT 1
- pdf2graph is missing
- pdfcocoon is missing
- Encrypted PDF viewable in mac without asking for password
- Adding timestamp signature
- is possible to convert normal PDF to Acro Form ?
- How to parse outline
- Invalid xref stream for lazy: true
- Ruby 3.0 & origami (2.1.0): Origami::Date.now throws ArgumentError HOT 1
- Ruby 3.1: LoadError - cannot load such file -- matrix
- How to extract pdf glyphs for each fonts
- still 2.7 Using the last argument as keyword parameters is deprecated; maybe ** should be added to the call
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from origami.