There was a code using iTextSharp:
PdfReader reader = new PdfReader(document);
PdfStamper st = PdfStamper.CreateSignature(reader, new FileStream(document + "_signed.pdf", FileMode.Create, FileAccess.Write), '\0');
PdfSignatureAppearance sap = st.SignatureAppearance;
// something
PdfSignature dic = new PdfSignature(filterName, PdfName.ADBE_PKCS7_DETACHED);
sap.CryptoDictionary = dic;
I need to write it using iText7:
PdfReader reader = new PdfReader(@"C:\Users\RakuVIu\Documents\rozha.pdf");
PdfSigner signer = new PdfSigner(reader, new FileStream(document + "_signed.pdf", FileMode.Create), new StampingProperties());
PdfSignatureAppearance appearance = signer.GetSignatureAppearance();
// something
PdfSignature signature = new PdfSignature(filterName, PdfName.Adbe_pkcs7_detached);
appearance.SetCryptoDictionary(signature); // no such method!
So, I cannot set CryptoDictionary property, because there is no method or property to do it.
The iText 7 signing API attempts to hide implementation details which shouldn't be used anymore since the 5.3.x signature API overhaul, and the signature dictionary is such a detail.
For details on the signature API introduced in the 5.3.x versions, please read the iText Digital Signatures white paper. The Java examples in there have been ported to C# and can be accessed here.