Friday, January 8, 2010

FIPS Compliant PDF Generation with iTextSharp

When working with PDF documents using iTextSharp, be sure to use version 5.0.0 if your system is required to use FIPS compliant algorithms. Without it, you will likely get something like the following error:


System.InvalidOperationException: This implementation is not part of the Windows Platform FIPS validated cryptographic algorithms.
at System.Security.Cryptography.MD5CryptoServiceProvider..ctor()
at iTextSharp.text.pdf.PdfEncryption.CreateDocumentId()
at iTextSharp.text.pdf.PdfWriter.Close()
at iTextSharp.text.Document.Close()


If you're upgrading from version 4.1.6 and you use Document.HeaderFooter, you'll have to refactor your code as it has been removed.

No comments: