SignatureFormatValidator Property

SignedXml.SignatureFormatValidator Property

.NET Framework 4.6 and 4.5

Gets a delegate that will be called to validate the format (not the cryptographic security) of an XML signature.

Namespace:   System.Security.Cryptography.Xml
Assembly:  System.Security (in System.Security.dll)

public Func<SignedXml, bool> SignatureFormatValidator { get; set; }

Property Value

Type: System.Func<SignedXmlBoolean>

true if the format is acceptable; otherwise, false.

This method can be used to ensure that only certain transforms are used, or that the signature uses a certain hash algorithm, and so on.

Setting the property to null removes all signature format validation from the SignedXml object.

You can also read the object's current delegate and chain to it if you want.

If you are setting up a format validator, the delegate you supply will receive as an input parameter the SignedXml object being verified and returns a Boolean value – true if the format is acceptable, false if it is not. If the delegate returns false for any reason, the SignedXml object will report that the XML signature is not valid.

.NET Framework
Available since 4.0
Return to top
© 2015 Microsoft