Show / Hide Table of Contents

Interface IXmlSignature

Supports XML signatures.

Namespace: ComponentSpace.Saml2.XmlSecurity.Signature
Assembly: ComponentSpace.Saml2.dll
Syntax
public interface IXmlSignature

Methods

Generate(XmlElement, AsymmetricAlgorithm, String, String, String, X509Certificate2)

Generates an XML signature.

Declaration
XmlElement Generate(XmlElement unsignedElement, AsymmetricAlgorithm signingKey, string digestAlgorithm, string signatureAlgorithm, string inclusiveNamespacesPrefixList = null, X509Certificate2 x509Certificate = null)
Parameters
Type Name Description
System.Xml.XmlElement unsignedElement

The XML to sign.

System.Security.Cryptography.AsymmetricAlgorithm signingKey

The signing key.

System.String digestAlgorithm

The digest algorithm.

System.String signatureAlgorithm

The signature algorithm.

System.String inclusiveNamespacesPrefixList

The inclusive namespace prefix list or null if none.

System.Security.Cryptography.X509Certificates.X509Certificate2 x509Certificate

The X.509 certificate to include in the signature or null if none.

Returns
Type Description
System.Xml.XmlElement

The XML signature.

Exceptions
Type Condition
SamlSignatureException

Thrown if an error occurs during signature generation.

Verify(XmlElement, AsymmetricAlgorithm)

Verifies an XML signature.

Declaration
bool Verify(XmlElement signedElement, AsymmetricAlgorithm verifyingKey)
Parameters
Type Name Description
System.Xml.XmlElement signedElement

The signed XML.

System.Security.Cryptography.AsymmetricAlgorithm verifyingKey

The verifying key.

Returns
Type Description
System.Boolean

true if the signature verifies; otherwise false.

Exceptions
Type Condition
SamlSignatureException

Thrown if an error occurs during signature verification.

In This Article
Back to top Copyright © ComponentSpace Pty Ltd 2017-2022. All rights reserved.