pdfbox-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Cassio Pereira <cas...@libercapital.com.br>
Subject Adding timestamp from P7S file
Date Tue, 06 Feb 2018 17:13:35 GMT
Hi,

I'm trying to add a timestamp to a signed pdf following the examples here:
https://svn.apache.org/viewvc/pdfbox/trunk/examples/src/main/java/org/apache/pdfbox/examples/signature/TSAClient.java?revision=1792644&view=markup

Using a service like FreeTSA, which follows RFC 3161, is working fine for
me.

However, the paid provider I have returns timestamps via P7S files, which
I'm assuming are PKCS (Public-Key Cryptography Standard) #7 format files.

Is there any way to extract the information from the P7S file and put it in
a format such as the one expected by TSAClient?

I'm attaching below the base64 representation of the timestamp file (p7s) I
have:

---cut here---
MIAGCSqGSIb3DQEHAqCAMIIKggIBAzEPMA0GCWCGSAFlAwQCAQUAMIIBUwYLKoZIhvcNAQkQAQSgggFCBIIBPjCCAToCAQEGCisGAQQB9H8CAQAwMTANBglghkgBZQMEAgEFAAQgGyKJFIm9FcdT088R/KwiSxCc/xt2+K9toh9JieLhkwoCBACeGgEYEzIwMTgwMjA1MTUwODE0LjEzMVowA4ABZAEB/wIIAmTRd0AjKtqggcikgcUwgcIxHTAbBgNVBAMMFEJSWS45MjQwNjE1My42MDA5NC5UMQswCQYDVQQGEwJCUjELMAkGA1UECAwCU0MxFjAUBgNVBAcMDUZsb3JpYW5vcG9saXMxGjAYBgNVBAoMEUJSeSBUZWNub2xvZ2lhIFNBMSUwIwYJKoZIhvcNAQkBFhZhdGVuZGltZW50b0BicnkuY29tLmJyMSwwKgYDVQQLDCNBdXRvcmlkYWRlIGRlIENhcmltYm8gZG8gVGVtcG8gLSBPTqCCBqAwggacMIIFhKADAgECAgIF1zANBgkqhkiG9w0BAQsFADCBszELMAkGA1UEBhMCQlIxCzAJBgNVBAgTAlNDMRYwFAYDVQQHEw1GbG9yaWFub3BvbGlzMRowGAYDVQQKExFCUnkgVGVjbm9sb2dpYSBTQTElMCMGA1UECxMcQXV0b3JpZG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WMBQGA1UEBxMNRmxvcmlhbm9wb2xpczEaMBgGA1UEChMRQlJ5IFRlY25vbG9naWEgU0ExJTAjBgNVBAsTHEF1dG9yaWRhZGUgQ2VydGlmaWNhZG9yYSBCUnkxHjAcBgNVBAMTFUJSeSBBQzIgLSBDbGFzc2UgMyB2MTEcMBoGCSqGSIb3DQEJARYNYWNAYnJ5LmNvbS5icgICBdcwDQYJYIZIAWUDBAIBBQCggYYwGgYJKoZIhvcNAQkDMQ0GCyqGSIb3DQEJEAEEMC8GCSqGSIb3DQEJBDEiBCDuMjBmjQBUWn3Tiu816u9T3+zWzMZbIc6xFFNgOyYirTA3BgsqhkiG9w0BCRACLzEoMCYwJDAiBCC4ZPAu0vwfDGrWJYuQ+fwisYxtfBZ3TKix6EmQYu9YUDANBgkqhkiG9w0BAQEFAASCAQB/pAbEQrObx1U6jwvESREAsFUhvBlH1RxdiFKkIqk+EScyX7RsD/eODquYnzKG3XehKkpxQ97eVk9ULTKMXlUUOR3vtMdaSHQQWyPrMHi3kpIUPzkXHOpwYB25eo8v5RvZ1K9YSwvmpLswBYPOi4qeAmAepQ1a6garfXk6CVcwNjQjtOqNwddnltwoym15evM5Zm3HvCPnuoxXcr7iSso69rJwYatv5DW89hCOqKc+pq49RMnN0BSGU761xSp3w4f3NLw5xcoPLz1gQseieYbfODnCPC9/r16ya1aZGXsTh6w2fAZcfX34c/kUiJTuZ7dp6G0VAMbqNcT/FBsE7vGTAAAAAA==
--- cut here ---

It can be decoded here for viewing
http://aaa-sec.com/other/jsasn1/index.html

Thanks,
Cássio

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message