External signatures are impossible to debug from a distance as it's
essentially your code that must be debugged. Look for hard-coded
assumptions, such as the key size, algorithms and so on.

Paulo

> -----Original Message-----
> From: [EMAIL PROTECTED] 
> [mailto:[EMAIL PROTECTED] On 
> Behalf Of Rene
> Sent: Thursday, April 26, 2007 7:20 AM
> To: [email protected]
> Subject: Re: [iText-questions] Problem with signing PDFs when 
> using2048-bitkey
> 
> hi Paulo,
> 
> thanks a lot for your answer.
> 
> I increased the value form 128 to 256 for making room for the 
> 2048-bit key. 
> The signing process works fine.
> 
> But when I open the PDF with the Acrobat Reader the build in 
> verification 
> says, that the document is not valid and has been modified. 
> Any suggestions 
> what do to now?
> 
> Thanks...
> 
> best regards,
> rene
> 
> the signing process works fine and the
> "Paulo Soares" <[EMAIL PROTECTED]> schrieb im Newsbeitrag 
> news:[EMAIL PROTECTED]
> > The examples assume 1024 long keys and that shows in things 
> like "new
> > byte[128]". Make sure that you make room for longer keys.
> >
> > Paulo
> >
> > ----- Original Message ----- 
> > From: "Rene" <[EMAIL PROTECTED]>
> > To: <[email protected]>
> > Sent: Wednesday, April 25, 2007 1:53 PM
> > Subject: [iText-questions] Problem with signing PDFs when 
> using 2048-bit 
> > key
> >
> >
> >> Hi,
> >>
> >> I am using iText 1.4.8 and try to sign PDFs with external generated
> >> signatures.
> >>
> >> Up till know it works fine (using different SmartCards 
> with 1024-bit key
> >> lenght). Today I tried a new card with 2048-bit RSA key and I get a
> >> problem when I try to copy the generated bytes into the 
> PdfDictinary.
> >> The generated Data is to much (I think because of the 
> 2048-bit key).
> >> I used the iText code example for inserting external signatures.
> >>
> >> Anyone a suggestion what to do to fix it? (with a SmartCard with a
> >> 1024-bit key everything works fine...).
> >>
> >> In the following you will find the code where occures the problem.
> >>
> >> Thanks for your help.
> >>
> >> Best regards,
> >> rene
> >>
> >> --------------------------------------
> >>
> >> PdfSigGenericPKCS sg = sap.getSigStandard();
> >> PdfLiteral slit = (PdfLiteral) sg.get(PdfName.CONTENTS);
> >> byte[] outc = new byte[(slit.getPosLength() - 2) / 2];
> >> PdfPKCS7 sig = sg.getSigner();
> >>
> >> /*
> >> create hash and signature...
> >> */
> >>
> >> // Sets the generated signature and hash of the PDF part(!!!)
> >> sig.setExternalDigest(job.getSignatur(), hash, "RSA"); 
> //$NON-NLS-1$
> >>
> >> // Creates the signedData-object and adds it into the temporary
> >> // PDF file.
> >> PdfDictionary dic = new PdfDictionary();
> >>
> >> byte[] ssig = sig.getEncodedPKCS7();
> >>
> >> System.arraycopy(ssig, 0, outc, 0, ssig.length); //sysout:
> >> PDF.Signatur.ssig: 3081 bytes, outc: 3014 bytes
> >> dic.put(PdfName.CONTENTS, new PdfString(outc)
> >>      .setHexWriting(true));


Aviso Legal:
Esta mensagem é destinada exclusivamente ao destinatário. Pode conter 
informação confidencial ou legalmente protegida. A incorrecta transmissão desta 
mensagem não significa a perca de confidencialidade. Se esta mensagem for 
recebida por engano, por favor envie-a de volta para o remetente e apague-a do 
seu sistema de imediato. É proibido a qualquer pessoa que não o destinatário de 
usar, revelar ou distribuir qualquer parte desta mensagem. 

Disclaimer:
This message is destined exclusively to the intended receiver. It may contain 
confidential or legally protected information. The incorrect transmission of 
this message does not mean the loss of its confidentiality. If this message is 
received by mistake, please send it back to the sender and delete it from your 
system immediately. It is forbidden to any person who is not the intended 
receiver to use, distribute or copy any part of this message.


-------------------------------------------------------------------------
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
_______________________________________________
iText-questions mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/itext-questions
Buy the iText book: http://itext.ugent.be/itext-in-action/

Reply via email to