private PdfName GetSignatureHashKey(String signatureName)
{
PdfDictionary dic = acroFields.GetSignatureDictionary(signatureName);
PdfString contents = dic.GetAsString(PdfName.CONTENTS);
byte[] bc = contents.GetOriginalBytes();
byte[] bt = null;
if (PdfName.ETSI_RFC3161.Equals(dic.GetAsName(PdfName.SUBFILTER)))
{
Asn1InputStream din = new Asn1InputStream(new MemoryStream(bc));
Asn1Object pkcs = din.ReadObject();
bc = pkcs.GetEncoded();
}
bt = HashBytesSha1(bc);
return(new PdfName(ConvertToHex(bt)));
}