Discussion:
[iText-questions] iTextSharp instance of BouncyCastle conflicting with standalone BouncyCastle library
Marcus Wong
2012-11-13 21:56:49 UTC
Permalink
Hello,

I am currently using the iTextSharp library (itextsharp.dll version 5.3)
inside a DLL written in C#. I also have a need to include the BouncyCastle
crypto library (BouncyCastle.CryptoExt.dll version 1.7.4114.6378) to the
same project, for the purposes of encrypting non-PDF files. The reference
to the DLLs are included via the .csproj file.

Come compile time I get the following error:

error CS0433: The type
'Org.BouncyCastle.Bcpg.OpenPgp.PgpLiteralDataGenerator' exists in both
'c:\Trunk\lib\BouncyCastle.CryptoExt.dll' and 'c:\Trunk\lib\itextsharp.dll'

The cause of this error is the copy of BouncyCastle embedded inside the
iTextSharp library, which has the same namespace as the standalone version
of BouncyCastle. Removing the reference to the standalone version of
BouncyCastle fixes the error, but this is not my preferred solution - I do
not want my file encryption/decryption code coupled to my PDF conversion
code.

Is there a version of the iTextSharp library that doesn't include
BouncyCastle , forcing it to use my external reference to the library? If
that is not possible, the only alternative I can see is to refactoring my
code to separate the PDF code from the file encryption/decryption code.

Regards,
Marcus
dobrinski
2016-03-20 14:48:52 UTC
Permalink
Hi,

How did you managed to solve this problem? I am facing the same problem and
I do not know how to solve it.

Thank you!



--
View this message in context: http://itext.2136553.n4.nabble.com/iTextSharp-instance-of-BouncyCastle-conflicting-with-standalone-BouncyCastle-library-tp4656946p4661017.html
Sent from the iText mailing list archive at Nabble.com.

------------------------------------------------------------------------------
Transform Data into Opportunity.
Accelerate data analysis in your applications with
Intel Data Analytics Acceleration Library.
Click to learn more.
http://pubads.g.doubleclick.net/gampad/clk?id=278785231&iu=/4140
_______________________________________________
iText-questions mailing list
iText-***@lists.sourceforge.net
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
Loading...