iText7 working with certificates using PKCS7 - itext

I'm migrating from iText 5.5.5 to iText 7.0.2 and I noticed that class com.itextpdf.text.pdf.security.PdfPKCS7 which I use to work with certificates and signatures is gone. Is there equivalent of the class in iText7 or has it been completley reworked? If so, where did the functionality moved?

Related

iText7 and C# - X509Certificate2Signature port can't sign using RSAcng

I'm trying to sign a PDF using iText7 the way I did with iText5:
I took the Cert from Windows Personal Store.
I create an IExternalSignature based on the Cert.
I found that X509Certificate2Signature class is not present in iText7.
Because of that I've ported it, however when the Signer method SignDetached is invoked I get that nasty error telling that the classic RSA algorithm is not available because now it is a bit different (RSAcng).
Is there a workaround?
For sure, there must be a reason why the class was not ported to iText7 that I can't understand.
Thanks.

How can i use XFAFlattener from iText in jruby?

I got inspiration from https://github.com/abevoelker/pdf_ravager to create XFA Flattening. I was trying to use the XFAWorker, which is a paid version. I am trying to get the trial version to work with jRuby. XFAFlattener cannot be instantiated since it says that the class cannot be found. I added the license key as well. I am doing all the experiment in jirb.
I am assuming i dont understand how license key works. Any suggestions will be great.

iText seems to break the PDF/A-1A conformance when applying a visible digital signature

I experience a problem when signing a PDF/A-1A document created with Microsoft Word 2013 and using iTextSharp with a visible signature. The signed document is no more conform, with the following errors from the PDF/A validator:
An end text operator is missing
A begin text operator is missing
A warning message is also displayed when printing the signed document with Acrobat (but not when opening the document).
Without a visbile signature the document remains conform.
I tested using iTextSharp release 5.5.7 and 5.5.8. Same effect. Signing the same PDF/A documents using acrobat reader or pro doesn't break the PDF/A-1A conformance. Signing PDF documents created by another software than MS Word 2013 (with the save as command) and using iText seems not to break the PDF/A-1A conformance.
The test documents can be downloaded here:
http://federalism.vserver.softronics.ch/itext/Pdf-Validation.pdf
http://federalism.vserver.softronics.ch/itext/Pdf-Validation.Signed.pdf
Online validators used: pdf-online, pdf-tools, Preflight (Adobe Acrobat). This validator also validates the signed document :-)
Is there any bug in the iText Library and any way to get a valid PDF/A-1A document?
Thanks for any help! Corto
Thanks for your answer. I tested a patch that iText delivered me in February. It solved the problem when printing the document (warning message). But the patch was probably not integrated in the final release (5.5.9) and the problem is not solved yet.
It will be fixed in iText 5.5.10.
If you cannot wait, these two commits fix the issue:
* https://github.com/itext/itextpdf/commit/f67e2a014217abbd123535325d6e5f5842ddb8f9
* https://github.com/itext/itextpdf/commit/057eb7ce9a22748854cfb5ff01d32f368141ed81

How do I decompile a .sis file?

I need to be able to view and edit a .sis file. Can anyone suggest the right way to do this please?
Basically, you could indeed extract stuff, modify them and re-pack them. there are tools that can help on this, for example SisContent claims to be able to do so, thus you could use this app at least for viewving the SIS.
Anyhow, the problem there is then the signing. If the app requires capabilities that are ok with Self-signing (and is not having any auto start feature etc.) then you could make own Self-signing certificate, either with the makekeys included in the SDK, or using OpenSSL. With SisContent, there also appears to be Self signing certificate included in it.
Anyhow note that following capabilities: ReadDeviceData, WriteDeviceData, PowerMgmt, ProtServ, SwEvent, SurroundingsDD, Trusted UI, CommDD, DiskAdmin, MultimediaDD, NetworkControl, CommDD, DiskAdmin, MultimediaDD and NetworkControl. Can not be used with self-signing, and as there is no ways on signing apps (and there were never a way on signing others apps) with real Symbian certificate having publicer ID. and thus these apps can not really be installed after they are modified.
Then again, if you are targeting for pre-3rd edition devices, then they are not requiring any signing, thus you could extract the files, modify them, and simply repack with makesis.
There is a software called unmakeSis.

Equivalent of Openssl RSA_PKCS1_OAEP_PADDING in IPhone Security framework and common crypto libraries

I am trying to convert code written in Openssl into the iphone’s built in security framework and crypto libraries. Is there an equivalent padding value RSA_PKCS1_OAEP_PADDING in the built in apple functions? Is there a value I can hardcode for my padding variable to get the same value?
Thanks in advance.
I worked around the padding issue by being able to incorporate Openssl so I don't have to use the crypto libraries.