Petr Masopust
On 28.6.2017 10:16, Tilman Hausherr wrote:
Am 28.06.2017 um 10:11 schrieb Petr Masopust:Hello,signatureEncoded is equal to cmsSignature in your code. It is computed by external company and I don't know how they create it and have no control about their code. But their signature was correctly inserted with pdfbox 1.8.12 and has invalid checksum with pdfbox 2.0.3.But you did not call sign(externalSigning.getContent()), that is the problem. So your code leaves it unclear where your signature came from, i.e. whether it was calculated from the full PDF minus the signature content area.TilmanBest regards Petr Masopust On 28.6.2017 10:04, Tilman Hausherr wrote:Am 28.06.2017 um 09:55 schrieb Petr Masopust:final ExternalSigningSupport externalSigningSupport = doc.saveIncrementalForExternalSigning(sink); externalSigningSupport.setSignature(signatureEncoded);It's too difficult to read your hex dump. However your code above looks weird: signatureEncoded is never computed. In the CreateVisibleSignature sample code, it looks like this:ExternalSigningSupport externalSigning = doc.saveIncrementalForExternalSigning(fos);// invoke external signature servicebyte[] cmsSignature = sign(externalSigning.getContent());externalSigning.setSignature(cmsSignature); doc.close(); signatureOptions.close(); I strongly recommend to start with the sample code. Tilman --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]-- *Petr Masopust* Programátor analytik ------------------------------------------------------------------------ *ICZ a.s.* Na hřebenech II 1718/10 140 00 Praha 4 Česká republika www.i.cz *Tel.:* +420 222 271 578 *GSM:* +420 724 429 623 *Fax:* +420 222 271 112 *E-mail:* [email protected]
-- *Petr Masopust* Programátor analytik ------------------------------------------------------------------------ *ICZ a.s.* Na hřebenech II 1718/10 140 00 Praha 4 Česká republika www.i.cz *Tel.:* +420 222 271 578 *GSM:* +420 724 429 623 *Fax:* +420 222 271 112 *E-mail:* [email protected]
smime.p7s
Description: S/MIME Cryptographic Signature

