Class CreateEmbeddedTimeStamp
- java.lang.Object
-
- org.apache.pdfbox.examples.signature.CreateEmbeddedTimeStamp
-
public class CreateEmbeddedTimeStamp extends java.lang.ObjectAn example for timestamp-signing a PDF for PADeS-Specification. The document will only be changed in its existing signature by a signed timestamp (A timestamp and the Hash-Value of the document are signed by a Time Stamp Authority (TSA)). This method only changes the unsigned parameters of a signature, so that it is kept valid. Use case: sign offline to avoid zero-day attacks against the signing machine. Once the signature is there and the pdf is transferred to a network connected machine, one is likely to want to add a timestamp. (Ralf Hauser)- Author:
- Alexis Suter
-
-
Constructor Summary
Constructors Constructor Description CreateEmbeddedTimeStamp(java.lang.String tsaUrl)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description voidembedTimeStamp(java.io.File file)Embeds the given PDF file with signed timestamp(s).voidembedTimeStamp(java.io.File inFile, java.io.File outFile)Embeds signed timestamp(s) into existing signatures of the given documentstatic voidmain(java.lang.String[] args)
-
-
-
Method Detail
-
embedTimeStamp
public void embedTimeStamp(java.io.File file) throws java.io.IOException, java.net.URISyntaxExceptionEmbeds the given PDF file with signed timestamp(s). Alters the original file on disk.- Parameters:
file- the PDF file to sign and to overwrite- Throws:
java.io.IOExceptionjava.net.URISyntaxException
-
embedTimeStamp
public void embedTimeStamp(java.io.File inFile, java.io.File outFile) throws java.io.IOException, java.net.URISyntaxExceptionEmbeds signed timestamp(s) into existing signatures of the given document- Parameters:
inFile- The pdf file possibly containing signaturesoutFile- Where the changed document will be saved- Throws:
java.io.IOExceptionjava.net.URISyntaxException
-
main
public static void main(java.lang.String[] args) throws java.io.IOException, java.net.URISyntaxException- Throws:
java.io.IOExceptionjava.net.URISyntaxException
-
-