How to sign with a timestamp and OCSP in C#

View: New views
2 Messages — Rating Filter:   Alert me  

How to sign with a timestamp and OCSP in C#

by jAy dEE-3 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Some parts of this message have been removed. Learn more about Nabble's security policy.
Paulo Soares told me to write the question to the mailing-list, instead to his email-adress...
So hopefully someone of you have used signing
with timestamps from verisign.
here's the original question:


Hello,

I'm trying to use ITextSharp to insert a signature into a pdfusing a timestamp from verisign and I've just found your example "How to sign with a timestamp and OCSP in C#"
on http://itextpdf.sourceforge.net/howtosign.html and tried it out with our certificate from Verisign and their TSA (http://timestamp.verisign.com/scripts/timestamp.dll).
But somehow it doesnt work and I get following EndOfStreamExecption: "DEF length 114 object truncated by 77" on the line

byte[] encodedSig = sgn.GetEncodedPKCS7(hash, cal, tsc, ocsp);

The Exception occurs in the Method GetTimeStampToken() of the class TSAClientBouncyCastle when validating the TimeStampResponse.

I've converted the repsonse byte array to a string and it says "error handling request, status = 0x9300"

According to the errorcodes/messages from Verisign I've found 0x9300 should be:

eTIMESTAMP_BAD_CONTENT_TYPE
• Cause: Request has a bad content type
• Action: Reject client’s request

Any idea what is going wrong here?

kind regards from Germany,
Jo(achim)




Surfen – optimiert für MSN.

Schnell, zuverlässig, einfach: hier Windows 7 kennenlernen!
------------------------------------------------------------------------------
Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day
trial. Simplify your report design, integration and deployment - and focus on
what you do best, core application coding. Discover what's new with
Crystal Reports now.  http://p.sf.net/sfu/bobj-july
_______________________________________________
itextsharp-questions mailing list
itextsharp-questions@...
https://lists.sourceforge.net/lists/listinfo/itextsharp-questions

Re: How to sign with a timestamp and OCSP in C#

by jAy dEE-3 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Some parts of this message have been removed. Learn more about Nabble's security policy.
Hi all,

ok, it seems that the Verisign TSA (http://timestamp.verisign.com/scripts/timestamp.dll) cannot be used for timestamping, as it uses Microsoft Authenticode protokoll I guess myself...
The example works however with an other TSA, so that problem here can be closed... (c;

But having another question (or should I open a new thread/post?)... maybe Paulo can help here out...

I want to use certificates from windows store instead of a .pfx-file, like the other sample with smartcards does...
can the timestamping example be combined with the smartcard one? Seems like they use "different methods"...
Maybe you (or any other) have an example for that or can give me a tip about? would be nice!

thanks and kind regards,
Jo




From: calljaydee@...
To: itextsharp-questions@...
Date: Mon, 14 Sep 2009 12:44:16 +0000
Subject: [itextsharp-questions] How to sign with a timestamp and OCSP in C#

Paulo Soares told me to write the question to the mailing-list, instead to his email-adress...
So hopefully someone of you have used signing
with timestamps from verisign.
here's the original question:


Hello,

I'm trying to use ITextSharp to insert a signature into a pdfusing a timestamp from verisign and I've just found your example "How to sign with a timestamp and OCSP in C#"
on http://itextpdf.sourceforge.net/howtosign.html and tried it out with our certificate from Verisign and their TSA (http://timestamp.verisign.com/scripts/timestamp.dll).
But somehow it doesnt work and I get following EndOfStreamExecption: "DEF length 114 object truncated by 77" on the line

byte[] encodedSig = sgn.GetEncodedPKCS7(hash, cal, tsc, ocsp);

The Exception occurs in the Method GetTimeStampToken() of the class TSAClientBouncyCastle when validating the TimeStampResponse.

I've converted the repsonse byte array to a string and it says "error handling request, status = 0x9300"

According to the errorcodes/messages from Verisign I've found 0x9300 should be:

eTIMESTAMP_BAD_CONTENT_TYPE
• Cause: Request has a bad content type
• Action: Reject client’s request

Any idea what is going wrong here?

kind regards from Germany,
Jo(achim)




Surfen – optimiert für MSN.

Schnell, zuverlässig, einfach: hier Windows 7 kennenlernen!

Schnell, zuverlässig, einfach: hier Windows 7 kennenlernen!
------------------------------------------------------------------------------
Come build with us! The BlackBerry® Developer Conference in SF, CA
is the only developer event you need to attend this year. Jumpstart your
developing skills, take BlackBerry mobile applications to market and stay
ahead of the curve. Join us from November 9-12, 2009. Register now!
http://p.sf.net/sfu/devconf
_______________________________________________
itextsharp-questions mailing list
itextsharp-questions@...
https://lists.sourceforge.net/lists/listinfo/itextsharp-questions