Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Signing file and include signature #251

Open
floers opened this issue Oct 12, 2023 · 3 comments
Open

Signing file and include signature #251

floers opened this issue Oct 12, 2023 · 3 comments

Comments

@floers
Copy link

floers commented Oct 12, 2023

Hello,

I want to sign a PDF file with rpgp as I would do it via gpg --clearsign --output signed.pdf test.pdf. I looked into the tests and tried it already but only came up with concatenating the required parts (signed message header, pdf content, signature) and writing them to the file. Unfortunately the result is not valid.

Thanks for your help.

@hko-s
Copy link
Contributor

hko-s commented Jan 24, 2024

Cleartext signatures are a mechanism that applies to text files (see https://openpgp.dev/book/signing_data.html#cleartext-signatures for some details). I don't think they can be used with a pdf?

Maybe a detached signature is what you want? (A detached signature is a small file that can be stored separately of the pdf file, and be used to verify the integrity of the pdf)

@wiktor-k
Copy link
Contributor

They might have been thinking about inline signatures (gpg --sign) that have the signed data and the signature in the same output file.

As you've said clearsigned binary files are not really a thing (although I guess technically it's possible to create them).

@dignifiedquire
Copy link
Member

you can use either StandaloneSignature or the cleartext construction in #328

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants