xml-signature

XSD Signature issue

半腔热情 提交于 2019-11-27 07:59:45
问题 I cannot resolve this error about <xs:element ref="ds:Signature"/> . I need some help please. Copyright (C) Microsoft Corporation. All rights reserved. Schema validation warning: The 'http://www.w3.org/2000/09/xmldsig#:Signature' el ement is not declared. Line 162, position 8. Warning: Schema could not be validated. Class generation may fail or may produce incorrect results. Warning: cannot generate classes because no top-level elements with complex type were found. XSD <xs:schema xmlns:xs=

Malformed Reference Element

天涯浪子 提交于 2019-11-27 07:53:24
问题 I am attempting to add References to my Security Header and am running into a fairly generic error: Malformed Reference Element I have tried the following with similar results: Referencing the element within the document by passing in the ID of the element as the URI of the Reference object. Passing an XmlElement object to the Reference through the LoadXml() method. I am retrieving the XmlElement reference by using the overloaded GetIdElement found on this StackOverflow post. When I pass in

'Malformed Reference Element' when adding a reference based on an Id attribute with SignedXml class

风流意气都作罢 提交于 2019-11-26 21:29:33
问题 Unable to sign element by Id attribute when there's a namespace prefix: void Main() { var doc = new XmlDocument(); doc.LoadXml("<root xmlns:u=\"myuri\"><test u:Id=\"_0\">Zebra</test></root>"); SignedXml signedXml = new SignedXml(doc); signedXml.SigningKey = new RSACryptoServiceProvider(); Reference reference = new Reference("#_0"); signedXml.AddReference(reference); signedXml.ComputeSignature(); } ComputeSignature() will fail here with 'Malformed Reference Element' how should this be done?