Ashish,

ashish dhingra wrote:
> I need to ask one think that whether i can sign at client end in a web
> application with itextsharp.The signature is on smart cad which is at
> client end.If not,i am signing at client end and i am generating
> signature.Now i want to put that signature on pdf using itextsharp.I tried
> following code,But when i open pdf and click on signature it shows
> following errors:-
> 1."Error while verification(BER Encoding)
> 2.Non-empty content info is required
> 3.Error during signature verification
> A little help will be appreciated.Hope for a quick and positve reply

The good news: You can generate integrated signatures on the client's end if
you are allowed to install all required components and have them run with
the required privileges. And if you are restricted in that respect, you can
split up the generation of an integrated PDF signature across different
processes, computers, and platforms; this might allow you to implement your
service nonetheless.

Now the bad news: You have to take care and really know what you're doing.
To learn, you might want to start by searching the mailing list archive for
threads on deferred and external signatures, and at the same time have a
look at the PDF specification and the relevant Adobe whitepapers on this.

ashish dhingra wrote:
> public static void SignHashed(byte[] pdf, string path,string
> path1,byte[]pdf_sign)
>     {
>         PdfReader reader = new PdfReader(path);
>         PdfStamper stp = PdfStamper.CreateSignature(reader, new
> FileStream(path1, FileMode.Create), '\0');
>         [...]
>         HashAlgorithm sha = new SHA1CryptoServiceProvider();
>         Stream s = sap.RangeStream;
>         int read = 0;
>         byte[] buff = new byte[8192];
>         while ((read = s.Read(buff, 0, 8192)) > 0)
>         {
>             sha.TransformBlock(buff, 0, read, buff, 0);
>         }
>         sha.TransformFinalBlock(buff, 0, 0);

This, e.g., already starts out wrong.

I gather your pdf_sign parameter is meant to represent an externally
generated signature. This can't work, you obviously cannot have a signature
as input to the method which creates the signature embedding envelope and
calculates the digest value which is to be signed.

Regards,   Michael.
-- 
View this message in context: 
http://itext-general.2136553.n4.nabble.com/Signing-with-itextsharp-tp3063346p3063513.html
Sent from the iText - General mailing list archive at Nabble.com.

------------------------------------------------------------------------------
Increase Visibility of Your 3D Game App & Earn a Chance To Win $500!
Tap into the largest installed PC base & get more eyes on your game by
optimizing for Intel(R) Graphics Technology. Get started today with the
Intel(R) Software Partner Program. Five $500 cash prizes are up for grabs.
http://p.sf.net/sfu/intelisp-dev2dev
_______________________________________________
iText-questions mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/itext-questions

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

Reply via email to