Sorry for botherting you, it was my faulty code after all. 2016-01-23 20:02 GMT+03:00 Tilman Hausherr <[email protected]>:
> Am 23.01.2016 um 17:44 schrieb Глеб Г.Г.: > >> Hello again! RC3 version works for previously signtd and encrypted files >> if >> I ommit encryption part in code. >> I encrypt my files with code I've shown you in JIRA thread PDFBOX-2729. >> But it fails to encrypt new files. Same code works on RC2 but gives me >> NullPointerException on RC3 in >> saveIncremental() call. >> > > Could you post your code and mention to what file it applies? > > You're not assumed to encrypt a file that has already been signed. This > doesn't make sense, it wouldn't be the same file. You first encrypt, then > you sign, and maybe sign again. > > Tilman > > > > Back then you said my code is faulty because one should not save and load >> file before applying signature. But how should I do it then? >> >> 2016-01-23 13:16 GMT+03:00 Глеб Г.Г. <[email protected]>: >> >> RC3 version works as you suggested. Thank you and whole team for great >>> work. >>> >>> 2016-01-19 22:52 GMT+03:00 Глеб Г.Г. <[email protected]>: >>> >>> Thank you, I'll will update my libraries to rc3 >>>> >>>> 2016-01-19 21:23 GMT+04:00 Tilman Hausherr <[email protected]>: >>>> >>>> Am 19.01.2016 um 17:59 schrieb Глеб Г.Г.: >>>>> >>>>> Dear mr. Hausherr! >>>>>> >>>>>> You've posted a comment, that my solution is incorrect, because I >>>>>> change >>>>>> and save initial encrypted PDF file before signing. >>>>>> Can you please provide some sample code how should I do it right way? >>>>>> >>>>>> Well, after the change (which is in 2.0 RC3), you can simply sign the >>>>> files as shown in the CreateVisibleSignature.java example. That is >>>>> what I >>>>> used for the attached files. It will take the unmodified source file >>>>> and >>>>> append the signature stuff. >>>>> >>>>> Tilman >>>>> >>>>> >>>>> >>>>> >>>>> 2015-12-21 23:12 GMT+03:00 Глеб Г.Г. <[email protected]>: >>>>>> >>>>>> I've posted comment on PDFBOX-2729 with my pdf's >>>>>> >>>>>>> 2015-12-21 23:56 GMT+04:00 Глеб Г.Г. <[email protected]>: >>>>>>> >>>>>>> I've posted my answer to stackoverflow. Files and passwords are >>>>>>> >>>>>>>> irrelevant in this case. >>>>>>>> >>>>>>>> 2015-12-21 23:21 GMT+04:00 Tilman Hausherr <[email protected]>: >>>>>>>> >>>>>>>> Am 21.12.2015 um 20:17 schrieb Глеб Г.Г.: >>>>>>>> >>>>>>>>> In my case I protect and then sign. This works on one signature, >>>>>>>>> but >>>>>>>>> >>>>>>>>>> fail >>>>>>>>>> on two. Looks like firs signature gets destroyed in process. >>>>>>>>>> >>>>>>>>>> I'm surprised it even works with the first signature. Feel free to >>>>>>>>>> >>>>>>>>> submit your code to PDFBOX-2729, including a PDF preferably in all >>>>>>>>> its >>>>>>>>> steps. Don't forget the password(s). >>>>>>>>> >>>>>>>>> Tilman >>>>>>>>> >>>>>>>>> >>>>>>>>> >>>>>>>>> 2015-12-21 22:11 GMT+03:00 Tilman Hausherr <[email protected] >>>>>>>>> >: >>>>>>>>> >>>>>>>>>> Hi, >>>>>>>>>> >>>>>>>>>> Protect after signing - don't know how without destroying the >>>>>>>>>>> signature(s) >>>>>>>>>>> validity; sign after protect - not yet: >>>>>>>>>>> https://issues.apache.org/jira/browse/PDFBOX-2729 >>>>>>>>>>> >>>>>>>>>>> Tilman >>>>>>>>>>> >>>>>>>>>>> >>>>>>>>>>> Am 21.12.2015 um 20:06 schrieb Глеб Г.Г.: >>>>>>>>>>> >>>>>>>>>>> By the way, is it even possible to protect with password a >>>>>>>>>>> document >>>>>>>>>>> >>>>>>>>>>> that >>>>>>>>>>>> is >>>>>>>>>>>> signed twice? >>>>>>>>>>>> >>>>>>>>>>>> 2015-12-21 22:01 GMT+03:00 Глеб Г.Г. <[email protected]>: >>>>>>>>>>>> >>>>>>>>>>>> Aw, forgive me big time! It was mine piece of code that created >>>>>>>>>>>> the >>>>>>>>>>>> issue. >>>>>>>>>>>> >>>>>>>>>>>> I was protecting document with password and this somehow messed >>>>>>>>>>>> >>>>>>>>>>>>> thing up, >>>>>>>>>>>>> even if I left passwords blank. >>>>>>>>>>>>> >>>>>>>>>>>>> 2015-12-21 21:45 GMT+03:00 Tilman Hausherr < >>>>>>>>>>>>> [email protected]>: >>>>>>>>>>>>> >>>>>>>>>>>>> Am 21.12.2015 um 19:43 schrieb Глеб Г.Г.: >>>>>>>>>>>>> >>>>>>>>>>>>> Or do I need to set specific >>>>>>>>>>>>> >>>>>>>>>>>>>> reopsitory? >>>>>>>>>>>>>> >>>>>>>>>>>>>>> Ooops, yes, indeed: >>>>>>>>>>>>>>> >>>>>>>>>>>>>>> https://pdfbox.apache.org/2.0/getting-started.html >>>>>>>>>>>>>>> >>>>>>>>>>>>>> >>>>>>>>>>>>>> |<repository> <id>ApacheSnapshot</id> <name>Apache >>>>>>>>>>>>>> Repository</name> >>>>>>>>>>>>>> <url> >>>>>>>>>>>>>> https://repository.apache.org/content/groups/snapshots/</url> >>>>>>>>>>>>>> <snapshots> <enabled>true</enabled> </snapshots> >>>>>>>>>>>>>> </repository>| >>>>>>>>>>>>>> >>>>>>>>>>>>>> >>>>>>>>>>>>>> >>>>>>>>>>>>>> >>>>>>>>>>>>>> >>>>>>>>>>>>>> >>>>>>>>>>>>>> >>>>>>>>>>> --------------------------------------------------------------------- >>>>>>>>>>> To unsubscribe, e-mail: [email protected] >>>>>>>>>>> For additional commands, e-mail: [email protected] >>>>>>>>>>> >>>>>>>>>>> >>>>>>>>>>> >>>>>>>>>>> >>>>>>>>>>> >>>>>>>>> --------------------------------------------------------------------- >>>>>>>>> To unsubscribe, e-mail: [email protected] >>>>>>>>> For additional commands, e-mail: [email protected] >>>>>>>>> >>>>>>>>> >>>>>>>>> >>>>>>>>> >>>>> --------------------------------------------------------------------- >>>>> To unsubscribe, e-mail: [email protected] >>>>> For additional commands, e-mail: [email protected] >>>>> >>>>> >>>>> > > --------------------------------------------------------------------- > To unsubscribe, e-mail: [email protected] > For additional commands, e-mail: [email protected] > >

