string alias = null; 
Pkcs12Store pk12 = new Pkcs12Store(new FileStream("c:\\myTestKey.pfx",
FileMode.Open, FileAccess.Read), "1234".ToCharArray());
IEnumerator i = pk12.Aliases.GetEnumerator();
while (i.MoveNext()) { 
    alias = ((string)i.Current); 
    if (pk12.IsKeyEntry(alias)) 
        break; 
} 
AsymmetricKeyParameter akp = pk12.GetKey(alias).Key;
X509CertificateEntry[] ce = pk12.GetCertificateChain(alias);
X509Certificate[] chain = new X509Certificate[ce.Length];
for (int k = 0; k < ce.Length; ++k) 
    chain[k] = ce[k].Certificate;
PdfReader reader = new PdfReader("c:\\NominesDigitals_Prova0b.pdf");
PdfStamper stp = PdfStamper.CreateSignature(reader, new
FileStream("c:\\hello_sig_cs.pdf", FileMode.Create), '\0');
PdfSignatureAppearance sap = stp.SignatureAppearance;
sap.SetCrypto(akp, chain, null, PdfSignatureAppearance.WINCER_SIGNED);
sap.Reason = "First Signature";
sap.Location = "Somewhere";
sap.SetVisibleSignature(new Rectangle(100, 100, 250, 200), 1, null);
stp.Close(); 

> -----Original Message-----
> From: [EMAIL PROTECTED] 
> [mailto:[EMAIL PROTECTED] On 
> Behalf Of Francisco Garrido Ortiz
> Sent: Wednesday, November 21, 2007 4:11 PM
> To: 'Post all your questions about iText here'
> Subject: Re: [iText-questions] Error on PdfStamper.CreateSignature()
> Importance: High
> 
> Hello.
> 
> I download the last .dll.
> 
> There any differences with old versions?!
> 
> But when I compile, I get the next errors:
> 
> C:\GIC2\02-Desarrollo\PDFcapaTEXT\All\TextExt\PDFSigner.cs(26)
> : The type or
> namespace name 'AsymmetricKeyParameter' could not be found 
> (are you missing
> a using directive or an assembly reference?)
> C:\GIC2\02-Desarrollo\PDFcapaTEXT\All\TextExt\PDFSigner.cs(36)
> : The type or
> namespace name 'AsymmetricKeyParameter' could not be found 
> (are you missing
> a using directive or an assembly reference?)
> C:\GIC2\02-Desarrollo\PDFcapaTEXT\All\TextExt\PDFSigner.cs(6):
>  The type or
> namespace name 'org' could not be found (are you missing a 
> using directive
> or an assembly reference?)
> C:\GIC2\02-Desarrollo\PDFcapaTEXT\All\TextExt\PDFSigner.cs(27)
> : The type or
> namespace name 'org' could not be found (are you missing a 
> using directive
> or an assembly reference?)
> C:\GIC2\02-Desarrollo\PDFcapaTEXT\All\TextExt\PDFSigner.cs(32)
> : The type or
> namespace name 'org' could not be found (are you missing a 
> using directive
> or an assembly reference?)
> C:\GIC2\02-Desarrollo\PDFcapaTEXT\All\TextExt\PDFSigner.cs(4):
>  The type or
> namespace name 'org' could not be found (are you missing a 
> using directive
> or an assembly reference?)
> C:\GIC2\02-Desarrollo\PDFcapaTEXT\All\TextExt\PDFSigner.cs(3):
>  The type or
> namespace name 'org' could not be found (are you missing a 
> using directive
> or an assembly reference?)
> 
> 
> 
> -----Original Message-----
> From: [EMAIL PROTECTED]
> [mailto:[EMAIL PROTECTED] On 
> Behalf Of Paulo
> Soares
> Sent: Wednesday, November 21, 2007 4:06 PM
> To: Post all your questions about iText here
> Subject: Re: [iText-questions] Error on PdfStamper.CreateSignature()
> 
> > -----Original Message-----
> > From: [EMAIL PROTECTED] 
> > [mailto:[EMAIL PROTECTED] On 
> > Behalf Of Francisco Garrido Ortiz
> > Sent: Wednesday, November 21, 2007 2:40 PM
> > To: 'Post all your questions about iText here'
> > Subject: Re: [iText-questions] Error on PdfStamper.CreateSignature()
> > Importance: High
> > 
> > OK. 
> > 
> > Whats the latest version?
> 
> The last C# version is 4.0.6.
> 
> > Can you send me the last ".dll"?
> >
> 
> https://sourceforge.net/project/showfiles.php?group_id=72954
>  
> > And You discover concrete the problem?
> >
> 
> Fix applied long ago.
> 
> Paulo


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: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2005.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
_______________________________________________
iText-questions mailing list
iText-questions@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/itext-questions
Buy the iText book: http://itext.ugent.be/itext-in-action/

Reply via email to