Table of Contents

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

unsignedElement XmlElement

The XML to sign.

signingKey AsymmetricAlgorithm

The signing key.

digestAlgorithm string

The digest algorithm.

signatureAlgorithm string

The signature algorithm.

inclusiveNamespacesPrefixList string

The inclusive namespace prefix list or null if none.

x509Certificate X509Certificate2

The X.509 certificate to include in the signature or null if 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

signedElement XmlElement

The signed XML.

verifyingKey AsymmetricAlgorithm

The verifying key.

Returns

bool

true if the signature verifies; otherwise false.

Exceptions

SamlSignatureException

Thrown if an error occurs during signature verification.