You already have a working solution.
Paulo
________________________________
From: Massa Alfonso [mailto:alfonso.ma...@insiel.it]
Sent: Thursday, February 02, 2012 9:07 AM
To: Post all your questions about iText here
Subject: [iText-questions] R: failure in verifyTimestampImprint with message
Imprint Algorithm SHA-256
So how can I do in the meanwhile to verify the TimestampImprint?
Can you help me to write a workaround in the meanwhile to do this?
Thanks in advance
Regards,
Alfonso
rispetta l’ambiente: se non ti e` necessario non stampare questa mail
Da: Paulo Soares [mailto:psoa...@glintt.com]
Inviato: martedì 31 gennaio 2012 10:38
A: Post all your questions about iText here
Oggetto: Re: [iText-questions] failure in verifyTimestampImprint with message
Imprint Algorithm SHA-256
Thank you for the code, it's correct. I'm adding PAdES-LTV verification support
and I've code similar to yours.
Paulo
________________________________
From: Massa Alfonso
[mailto:alfonso.ma...@insiel.it]<mailto:[mailto:alfonso.ma...@insiel.it]>
Sent: Monday, January 30, 2012 2:06 PM
To:
itext-questions@lists.sourceforge.net<mailto:itext-questions@lists.sourceforge.net>
Subject: [iText-questions] failure in verifyTimestampImprint with message
Imprint Algorithm SHA-256
Hi,
I have a timestamp that was built with an algorithm SHA-256. When I use the
verifyTimestampImprint() function to verify the timestamp, it fails.
Thus, I had to change the function as follows:
public boolean verifyTimestampImprint() throws NoSuchAlgorithmException {
if (timeStampToken == null)
return false;
TimeStampTokenInfo info = timeStampToken.getTimeStampInfo();
MessageImprint imprint = info.toTSTInfo().getMessageImprint();
String algOID = info.getMessageImprintAlgOID();
byte[] md = MessageDigest.getInstance(algOID).digest(digest);
byte[] imphashed = imprint.getHashedMessage();
boolean res = Arrays.equals(md, imphashed);
return res;
}
and it works.
If you found other ways to verify timestamp built with an algorithm SHA-256
please let me know.
Regards,
Alfonso Massa
________________________________
AVVISO DI RISERVATEZZA
Informazioni riservate possono essere contenute nel messaggio o nei suoi
allegati. Se non siete i destinatari indicati nel messaggio, o responsabili per
la sua consegna alla persona, o se avete ricevuto il messaggio per errore,
siete pregati di non trascriverlo, copiarlo o inviarlo a nessuno. In tal caso
vi invitiamo a cancellare il messaggio ed i suoi allegati. Grazie.
CONFIDENTIALITY NOTICE
Confidential information may be contained in this message or in its
attachments. If you are not the addressee indicated in this message, or
responsible for message delivering to that person, or if you have received this
message in error, you may not transcribe, copy or deliver this message to
anyone. In that case, you should delete this message and its attachments. Thank
you.
________________________________
AVVISO DI RISERVATEZZA
Informazioni riservate possono essere contenute nel messaggio o nei suoi
allegati. Se non siete i destinatari indicati nel messaggio, o responsabili per
la sua consegna alla persona, o se avete ricevuto il messaggio per errore,
siete pregati di non trascriverlo, copiarlo o inviarlo a nessuno. In tal caso
vi invitiamo a cancellare il messaggio ed i suoi allegati. Grazie.
CONFIDENTIALITY NOTICE
Confidential information may be contained in this message or in its
attachments. If you are not the addressee indicated in this message, or
responsible for message delivering to that person, or if you have received this
message in error, you may not transcribe, copy or deliver this message to
anyone. In that case, you should delete this message and its attachments. Thank
you.
------------------------------------------------------------------------------
Keep Your Developer Skills Current with LearnDevNow!
The most comprehensive online learning library for Microsoft developers
is just $99.99! Visual Studio, SharePoint, SQL - plus HTML5, CSS3, MVC3,
Metro Style Apps, more. Free future releases when you subscribe now!
http://p.sf.net/sfu/learndevnow-d2d
_______________________________________________
iText-questions mailing list
iText-questions@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/itext-questions
iText(R) is a registered trademark of 1T3XT BVBA.
Many questions posted to this list can (and will) be answered with a reference
to the iText book: http://www.itextpdf.com/book/
Please check the keywords list before you ask for examples:
http://itextpdf.com/themes/keywords.php