subasi,

please also supply a sample PDF produced by your code. I don't have a 
iTextSharp testbed installation as I'm mostly working with Java. Thus, I cannot 
easily create a sample to look at.

Please also keep questions to the mailing list.

Regards,   Michael

-------- Original-Nachricht --------
> Datum: Fri, 16 Dec 2011 06:00:06 -0800
> Von: [email protected]
> An: [email protected]
> Betreff: deferred signing with mobile signature

> Hi Mike,
> 
> I guess you have an experience on that issue. I want to sign a pdf file
> with mobile signature so i did sth but got an error like "..ber decoding..".
> 
> here is my code snipplets.
> Please give your valuable advice on that.
> 
> 
> // reader and stamper
>             PdfReader reader = new PdfReader(src);
>             FileStream fout = new FileStream(dest, FileMode.Create);
>             PdfStamper stp = PdfStamper.CreateSignature(reader, fout,
> '\0');
>             byte[] hash = new byte[20];
>             byte[] pk = new byte[128];
> 
>             PdfSignatureAppearance sap = stp.SignatureAppearance;
>             
>             
>             sap.SignDate = DateTime.Now.Date;
>             
>             //sap.SetExternalDigest(pk, hash, "RSA");
>             sap.Reason = "GSM Signing";
>             sap.Location = "Universe";
>             sap.Acro6Layers = true;
>            // sap.Render =
> PdfSignatureAppearance.SignatureRender.NameAndDescription;
> 
>             sap.Layer2Text = "signature\n"+sap.Reason+"\n"+sap.Location; 
> 
>             PdfSignature sigDic = new PdfSignature(PdfName.ADOBE_PPKMS,
> PdfName.ADBE_PKCS7_DETACHED);
>             sigDic.Put(PdfName.FT, PdfName.SIG);
>             sigDic.Date = (new PdfDate(sap.SignDate));
>       
>             sigDic.Reason = "Mobile Signing";
>             sigDic.Location = "Universe";
>             sigDic.Contact = "blah.blah.";
> 
>             sap.SetVisibleSignature(new Rectangle(50, 10, 240, 70),
> reader.NumberOfPages, "İmza");
>             sap.Layer2Font = (FontFactory.GetFont(FontFactory.TIMES,
> "windows-1254", 8));
>             
>             sap.CryptoDictionary = sigDic;
> 
>             sap.SetExternalDigest(pk, hash, "RSA");
>             
> 
>             int csize = 4000;
>             Dictionary<PdfName,int> exc = new Dictionary<PdfName,int>();
>             exc.Add(PdfName.CONTENTS, csize * 2 + 2);
>             sap.PreClose(exc);
> 
>             hash = getPdfHash(sap.RangeStream);
>             
> 
>             GSMSignApi ei = new GSMSignApi();
>             ei.Mobilİmzala("053xxxxxxxx", "gsml", encodeTo64(hash), "pdf
> signing", 120);
>          
>             pk = base64DecodeToByteArr(eimza.getImzaDegeri()); ////deneme
> amacli
>             
> 
>             
>           
> 
>             sap.SetExternalDigest(pk, hash, "RSA");
> 
>             byte[] outc = new byte[csize];
> 
>             PdfDictionary dic2 = new PdfDictionary();
> 
>             Array.Copy(pk, 0, outc, 0, pk.Length);
> 
>             dic2.Put(PdfName.CONTENTS, new
> PdfString(outc).SetHexWriting(true));
>             
> 
>             sap.Close(dic2);
> 

-- 
NEU: FreePhone - 0ct/min Handyspartarif mit Geld-zurück-Garantie!               
Jetzt informieren: http://www.gmx.net/de/go/freephone

------------------------------------------------------------------------------
Learn Windows Azure Live!  Tuesday, Dec 13, 2011
Microsoft is holding a special Learn Windows Azure training event for 
developers. It will provide a great way to learn Windows Azure and what it 
provides. You can attend the event by watching it streamed LIVE online.  
Learn more at http://p.sf.net/sfu/ms-windowsazure
_______________________________________________
iText-questions mailing list
[email protected]
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

Reply via email to