iText release notes mention that signing of PDFs with XFA forms is supported from iText versions 5.4.2 and 5.4.3:
http://itextpdf.com/history/?branch=54&node=542
http://itextpdf.com/history/?branch=54&node=543
Is there a documentation somewhere how to do the signing in Java?
I am specifically interested in signing PDFs with XFA where there is a prepared field for signature.
This is a small example showing how to sign using XmlDSig:
You can also sign using XAdES, but then you won't be able to validate the signature in Adobe software because I don't think Adobe already supports XAdES (please correct me if I'm wrong).