Interface IXmlSignature
- Namespace
- ComponentSpace.Saml2.XmlSecurity.Signature
- Assembly
- ComponentSpace.Saml2.dll
Supports XML signatures.
public interface IXmlSignature
Methods
Generate(XmlElement, AsymmetricAlgorithm, string, string, string, X509Certificate2)
Generates an XML signature.
XmlElement Generate(XmlElement unsignedElement, AsymmetricAlgorithm signingKey, string digestAlgorithm, string signatureAlgorithm, string inclusiveNamespacesPrefixList = null, X509Certificate2 x509Certificate = null)
Parameters
unsignedElementXmlElementThe XML to sign.
signingKeyAsymmetricAlgorithmThe signing key.
digestAlgorithmstringThe digest algorithm.
signatureAlgorithmstringThe signature algorithm.
inclusiveNamespacesPrefixListstringThe inclusive namespace prefix list or
nullif none.x509CertificateX509Certificate2The X.509 certificate to include in the signature or
nullif none.
Returns
- XmlElement
The XML signature.
Exceptions
- SamlSignatureException
Thrown if an error occurs during signature generation.
Verify(XmlElement, AsymmetricAlgorithm)
Verifies an XML signature.
bool Verify(XmlElement signedElement, AsymmetricAlgorithm verifyingKey)
Parameters
signedElementXmlElementThe signed XML.
verifyingKeyAsymmetricAlgorithmThe verifying key.
Returns
- bool
trueif the signature verifies; otherwisefalse.
Exceptions
- SamlSignatureException
Thrown if an error occurs during signature verification.