public P7kSignInfo(DigestSession digest, int pades, int p7k, int x509, int num, SignTypes signType) { SignType = signType.ToString(); SignDate = (DateTime?)digest.P7kGetSignAttribute(p7k, num, "signingTime"); var unstructuredName = digest.P7kGetSignAttribute(p7k, false, num, "unstructuredName"); Reason = GetReason((string)unstructuredName); switch (signType) { case SignTypes.PAdES: IsVerified = digest.PADES_Verify(pades); break; default: IsVerified = digest.P7kVerifySignature(p7k, num); break; } Certificate = new SigningCertificate() { SerialNumber = digest.X509GetInfo(x509, enumCertInfoCategory.CC_GENERAL, enumCertInfoItem.CI_SERIALNUMBER), NotBefore = digest.X509GetInfo(x509, enumCertInfoCategory.CC_GENERAL, enumCertInfoItem.CI_VALID_FROM).ChangeType <DateTime>(), NotAfter = digest.X509GetInfo(x509, enumCertInfoCategory.CC_GENERAL, enumCertInfoItem.CI_VALID_TO).ChangeType <DateTime>() }; Certificate.Issuer = new IssuerDN() { SerialNumber = digest.X509GetInfo(x509, enumCertInfoCategory.CC_ISSUER, enumCertInfoItem.CI_SERIALNUMBER), Organization = digest.X509GetInfo(x509, enumCertInfoCategory.CC_ISSUER, enumCertInfoItem.CI_NAME) }; Certificate.Subject = new SubjectDN() { SerialNumber = digest.X509GetInfo(x509, enumCertInfoCategory.CC_SUBJECT, enumCertInfoItem.CI_FISCALCODE), GivenName = digest.X509GetInfo(x509, enumCertInfoCategory.CC_SUBJECT, enumCertInfoItem.CI_FIRSTNAME), Surname = digest.X509GetInfo(x509, enumCertInfoCategory.CC_SUBJECT, enumCertInfoItem.CI_LASTNAME), CommonName = digest.X509GetInfo(x509, enumCertInfoCategory.CC_SUBJECT, enumCertInfoItem.CI_NAME) }; }
public TSSignInfo(DigestSession digest, int p7x, int ts, int index) { SignType = SignTypes.TimeStamp.ToString(); SignDate = digest.TSGetDateAndTime(ts); IsVerified = digest.TSVerify(ts); Certificate = new SigningCertificate() { SerialNumber = digest.TSGetTSPInfo(ts, enumCertInfoCategory.CC_GENERAL, enumCertInfoItem.CI_SERIALNUMBER), NotBefore = digest.TSGetTSPInfo(ts, enumCertInfoCategory.CC_GENERAL, enumCertInfoItem.CI_VALID_FROM).ChangeType <DateTime>(), NotAfter = digest.TSGetTSPInfo(ts, enumCertInfoCategory.CC_GENERAL, enumCertInfoItem.CI_VALID_TO).ChangeType <DateTime>() }; Certificate.Issuer = new IssuerDN() { Organization = digest.TSGetTSPInfo(ts, enumCertInfoCategory.CC_ISSUER, enumCertInfoItem.CI_NAME) }; Certificate.Subject = new SubjectDN() { CommonName = digest.TSGetTSPInfo(ts, enumCertInfoCategory.CC_SUBJECT, enumCertInfoItem.CI_NAME) }; }
public P7kSignInfo(DigestSession digest, int p7k, int x509, int num) : this(digest, 0, p7k, x509, num, SignTypes.CAdES) { }