public CadesSignatureModel(Lacuna.Pki.Cades.CadesSignature signature, ICadesPolicyMapper policyMapper) { if (signature.EncapsulatedContentType == CmsContentType.Data) { EncapsulatedContentType = CmsContentTypes.Data; } else if (signature.EncapsulatedContentType == CmsContentType.SignedData) { EncapsulatedContentType = CmsContentTypes.SignedData; } else if (signature.EncapsulatedContentType == CmsContentType.EnvelopedData) { EncapsulatedContentType = CmsContentTypes.EnvelopedData; } else if (signature.EncapsulatedContentType == CmsContentType.DigestedData) { EncapsulatedContentType = CmsContentTypes.DigestedData; } else if (signature.EncapsulatedContentType == CmsContentType.EncryptedData) { EncapsulatedContentType = CmsContentTypes.EncryptedData; } else if (signature.EncapsulatedContentType == CmsContentType.AuthenticatedData) { EncapsulatedContentType = CmsContentTypes.AuthenticatedData; } else if (signature.EncapsulatedContentType == CmsContentType.TstInfo) { EncapsulatedContentType = CmsContentTypes.TstInfo; } HasEncapsulatedContent = signature.HasEncapsulatedContent; EncapsulatedContent = signature.GetEncapsulatedContent(); Signers = signature.Signers.Select(s => new CadesSignerInfoModel(s, policyMapper, signature)).ToList(); }
public ValidationResultsModel(CadesSignerInfo signerInfo, ICadesPolicyMapper policyMapper, Lacuna.Pki.Cades.CadesSignature signature) : this(signature.ValidateSignature(signerInfo, policyMapper)) { }
public CadesSignerInfoModel(CadesSignerInfo signerInfo, ICadesPolicyMapper policyMapper, Lacuna.Pki.Cades.CadesSignature signature) : this(signerInfo) { ValidationResults = new ValidationResultsModel(signerInfo, policyMapper, signature); }