When SignedXml.CheckSignature(AsymmetricAlgorithm key)
returns true
(or false
), what exactly does this represent does this represent?
Does this mean that the Signature
is valid; or that whatever Signature
object you created matches when you tried to create the Signature
again?
The SignedXml.CheckSignature(AsymmetricAlgorithm key)
does three checks:
SignedInfo
in the signature is signed by the supplied key. This ensure that the data is from a sender with the corresponding public key.SignedInfo
is correct. This ensures that the contents of the Signature
block has not been tampered with.Note that you at this point has no idea what data is actually signed - it might be only parts of the document. Before trusting data, you also have to validate the signatures.