sign xml file with FIRMAXADESNET
I AM SIGNING AN XML FILE WITH THE NUGET FIRMAXADESNET PACKAGE, SO WHEN I GO TO VALIDATE THE ERROR OF IT WAS NOT POSSIBLE TO VALIDATE/EXTEND THE SIGNATURE. REFERENCE '#SIGNEDPROPERTIES-SIGNATURE-7DAFA379-4D0D-419E-8E9E-2154627C9BA3' CANNOT BE VALIDATED. my code:
private void Assign(X509Certificate2 cCertUtil, string nomeFileXml, XmlDocument xml)
{
XadesService xadesService = new XadesService(); SignatureParameters parametri = new SignatureParameters(); parametri.SignaturePolicyInfo.PolicyDigestAlgorithm = FirmaXadesNet.Crypto.DigestMethod.SHA256; parametri.SignatureMethod = SignatureMethod.RSAwithSHA256; parametri.DigestMethod = FirmaXadesNet.Crypto.DigestMethod.SHA256; parametri.SigningDate = DateTime.Now; parametri.SignaturePackaging = SignaturePackaging.ENVELOPED; using (parametri.Signer = new Signer(cCertUtil)) { using (FileStream fs = new FileStream(nomeFileXml, FileMode.Open)) { var xml1 = xadesService.Sign(fs, parametri); xml = xml1.Document; } } xml.Save(UID);
}