The UWP framework is apparently an update to the .NET ecosystem, especially in terms of security and cryptography. For example, in UWP, the hash algorithm classes are located in the Windows.Security.Cryptography.Core
namespace, and before .NET 4.x they are in System.Security.Cryptography
. Some classes have also been renamed.
This is a modified change for iTextSharp, as well as for its security dependency, BouncyCastle, because the System.Security.Cryptography
assembly is used for digital signatures. NuGet or UWP seem to be aware of .NET assemblies that are being used and refuse to add dependencies that will not compile into UWP, regardless of whether you use any iTextSharp features related to digital signatures.
FYI I am an employee of iText, and we discovered this problem just a few weeks ago. The investigation is still ongoing, so I may not understand everything in this explanation. We are also working on a support strategy for both UWP and .NET 4.x - which, as I understand it, are mutually exclusive when it comes to cryptography. If you use Google the term "is not compatible with UAP"
, then you can read about similar problems for many well-known libraries, so this is not only a problem for iTextSharp.
EDIT
If you really need a solution quickly, you can download the source code of iTextSharp and copy it into a new UWP class library project in Visual Studio. The number of compilation errors looks daunting, but about 80% of them seem trivial to me. for example, Half of them are references to Serializable and SerializationInfo in the inherited constructor of Exception classes that no longer exist, so they can be () deleted safely.
An alternative is to wait for the new version of iTextSharp, for which there is currently no (planned January 6, 2016) release date. In addition, to be clear, no decision has been made as to whether and how to support UWP with the next version or any next version in iTextSharp.
EDIT 2
I recently wrote a blog post about this issue as an official expression of the iText team. http://itextpdf.com/blog/itextsharp-and-uwp