public CertificateModel(PKCertificate c) { SubjectName = new NameModel(c.SubjectName); EmailAddress = c.EmailAddress; IssuerName = new NameModel(c.IssuerName); ValidityStart = c.ValidityStart; ValidityEnd = c.ValidityEnd; PkiBrazil = new PkiBrazilCertificateModel(c.PkiBrazil); if (!c.IsSelfSigned) { Issuer = new CertificateModel(c.Issuer); } }
public CadesSignerInfoModel(CadesSignerInfo signerInfo) { MessageDigest = new DigestAlgorithmAndValueModel(signerInfo.DigestAlgorithm, signerInfo.MessageDigest); Signature = new SignatureAlgorithmAndValueModel(signerInfo.SignatureAlgorithm, signerInfo.SignatureValue); if (signerInfo.SignaturePolicy != null) { SignaturePolicy = new SignaturePolicyIdentifierModel(signerInfo.SignaturePolicy); } Certificate = new CertificateModel(signerInfo.SigningCertificate); Timestamps = signerInfo.SignatureTimeStamps.Select(s => new CadesTimestampModel(s)).ToList(); try { bool isCertified; var dateReference = signerInfo.GetDateReference(out isCertified); if (isCertified) { CertifiedDateReference = dateReference; } } catch { } }