first of all, merry xmas and a happy new year.
sry for the late answer. i'm relocated this month and still waiting for my internet.
@ Adam Nichols added a comment - 17/Dec/10 05:26 AM
to pass the int isn't a good idea.
1. the signature interface should be abstract as possible. so it should help the user to implement a crypto library as easy as possible.
2. the byterange can only be calculated inside the pdfbox, why inform the sign library about the byterange and make it harder to implement a filterinputstream. for each implementation.
Adam Nichols added a comment - 23/Dec/10 11:14 AM
setConents(new byte[...]) is set to the large size because we used the implementation for some signature cards that used a large certificate chain.
the amount of bytes can be set lower or a better way is to calculate the certificate chain size before writing it down into the signature.
a other way is to give the pdfbox a size for the signature via the class signatureoptions. so the user can set his own size.
Sry for the german comments inside the code. there is so much code i can't handle it self without comments and the easiest and fastest way are german comments for me But i will do some english comments for new code.
ps: your german seams to be good
1. The method saveIncremental(...) should accept the same param as the save() method. The cause why i used a input and output stream for params is, because i need to read the whole file again for writing the signature on the right place. There is no way to mix a input/outputstream so maybe a random access file is a better solution.
2. can the signature implemention be an own jar file? not every person need this implementation for the pdfbox. the incremental update i thing will not working in the regular code at all.
3. the signature implementation doesn't work with encrypted or with linearized documents. for linearized documents there need to be a xrefstream writer as well. encrypted documents need to be decrypted before signing it.
hope you can understand my english got my secound xmas drink (glühwein / eierpunsch) now and can hardly write.