public XmldsigForWidgetDigSig(WidgetDigSig role, SHA256WithRSA signer, string root) { Role = role; SigningRoot = root; Signer = signer; CertificateChain = new List <string>(signer.Base64KeyChain); }
public XmldsigForWidgetDigSig(WidgetDigSig role, SHA512WithRSA signer, string root) { Role = role; SigningRoot = root.TrimEnd(new[] { '/', '\\' }); Signer = signer; CertificateChain = new List <string>(signer.Base64KeyChain); }
private void CreateSignedXML(string filename, string root, WidgetDigSig role, string pkcs12, string password) { pkcs12 = Path.GetFullPath(pkcs12); if (string.IsNullOrEmpty(password)) { password = Utility.AskPassword($"Insert Password of {pkcs12} : "); } SHA512WithRSA sha = new SHA512WithRSA(pkcs12, password); XmldsigForWidgetDigSig xmld = new XmldsigForWidgetDigSig(role, sha, root); var sig = xmld; string signedXml = Path.Combine(root, filename); File.WriteAllText(signedXml, sig.ToString().Replace("\r\n", "\n")); }