Discussion:
[itextsharp-questions] Reference problem with sample iTextSharp code
Joao Silva
2007-10-26 11:14:18 UTC
Permalink
Dear Paulo,

I need your help
I copy/pasted the code available in
http://itextpdf.sourceforge.net/howtosign.html#signextitextsharp2
Im in .NET using iTextSharp.

When building the solution is shows the following errors:

The name 'X509Certificate2UI' does not exist in the current context
The name 'X509SelectionFlag' does not exist in the current context

The type or namespace name 'ContentInfo' could not be found (are you missing a
using directive or an assembly reference?)

The type or namespace name 'SignedCms' could not be found (are you missing a
using directive or an assembly reference?)

The type or namespace name 'CmsSigner' could not be found (are you missing a
using directive or an assembly reference?)

I understand its the references, but im confused. There are so many, including
both upper and lowercase org.bouncycastle, several itext versions... uff, im
trying to solve the problem for a week now....


Thanks in advance, great tool!

Um abraço do Porto
Paulo Soares
2007-10-26 13:43:52 UTC
Permalink
Are you using .NET 2.0?

Paulo
-----Original Message-----
On Behalf Of Joao Silva
Sent: Friday, October 26, 2007 12:14 PM
Subject: [itextsharp-questions] Reference problem with sample
iTextSharp code
Dear Paulo,
I need your help
I copy/pasted the code available in
http://itextpdf.sourceforge.net/howtosign.html#signextitextsharp2
Im in .NET using iTextSharp.
The name 'X509Certificate2UI' does not exist in the current context
The name 'X509SelectionFlag' does not exist in the current context
The type or namespace name 'ContentInfo' could not be found
(are you missing a
using directive or an assembly reference?)
The type or namespace name 'SignedCms' could not be found
(are you missing a
using directive or an assembly reference?)
The type or namespace name 'CmsSigner' could not be found
(are you missing a
using directive or an assembly reference?)
I understand its the references, but im confused. There are
so many, including
both upper and lowercase org.bouncycastle, several itext
versions... uff, im
trying to solve the problem for a week now....
Thanks in advance, great tool!
Um abraço do Porto
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,
Joao Silva
2007-10-26 14:22:10 UTC
Permalink
Post by Paulo Soares
Are you using .NET 2.0?
Paulo
Yes .NET Framework 2.050727

Let me add that i tried lots of code available in the internet, none worked.
tryed to correct the errors but nothing..
Paulo Soares
2007-10-26 14:34:24 UTC
Permalink
Go to Project->Add Reference to add the references needed.

Paulo
-----Original Message-----
On Behalf Of Joao Silva
Sent: Friday, October 26, 2007 3:22 PM
Subject: Re: [itextsharp-questions]Reference problem with
sample iTextSharp code
Post by Paulo Soares
Are you using .NET 2.0?
Paulo
Yes .NET Framework 2.050727
Let me add that i tried lots of code available in the
internet, none worked.
tryed to correct the errors but nothing..
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.
Joao Silva
2007-10-26 14:39:23 UTC
Permalink
Post by Paulo Soares
Go to Project->Add Reference to add the references needed.
Paulo
Ive done it.
Ive added bccrypto-csharp-b02 and itextsharp as well as

using System.Collections;
using System.Security.Cryptography.X509Certificates;
using System.Security.Cryptography;
using iTextSharp.text.pdf;
using iTextSharp.text.xml.xmp;


using System.IO;
using System.Collections;
using System.util;

using Org.BouncyCastle.X509; <<--- upper and lowercase bouncycastle.none work
using org.bouncycastle.x509;
using org.bouncycastle.pkcs;
using org.bouncycastle.security;
using Org.BouncyCastle.Crypto;


anything more needed?
Paulo Soares
2007-10-26 14:47:18 UTC
Permalink
Don't add bccrypto-csharp-b02 as it's already included in iTextSharp.
You'll need a reference to System.Security.dll.

Paulo
-----Original Message-----
On Behalf Of Joao Silva
Sent: Friday, October 26, 2007 3:39 PM
Subject: Re: [itextsharp-questions]Reference problem with
sample iTextSharp code
Post by Paulo Soares
Go to Project->Add Reference to add the references needed.
Paulo
Ive done it.
Ive added bccrypto-csharp-b02 and itextsharp as well as
using System.Collections;
using System.Security.Cryptography.X509Certificates;
using System.Security.Cryptography;
using iTextSharp.text.pdf;
using iTextSharp.text.xml.xmp;
using System.IO;
using System.Collections;
using System.util;
using Org.BouncyCastle.X509; <<--- upper and lowercase
bouncycastle.none work
using org.bouncycastle.x509;
using org.bouncycastle.pkcs;
using org.bouncycastle.security;
using Org.BouncyCastle.Crypto;
anything more needed?
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.
Joao Silva
2007-10-26 15:01:31 UTC
Permalink
Post by Paulo Soares
Don't add bccrypto-csharp-b02 as it's already included in iTextSharp.
You'll need a reference to System.Security.dll.
Paulo
In that case Org* references must be removed from the document ("using
org...") right. seems like even more errors are raised :(

and i've already added the system.security... :( forgot to mention

what should i do?

it doesnt recognize Keystore, X509Certificate2UI, X509SelectionFlag..

as i said, i copy/pasted your code...

Loading...