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 |
|---|---|---|
| XmlElement | unsignedElement | The XML to sign. |
| AsymmetricAlgorithm | signingKey | The signing key. |
| string | digestAlgorithm | The digest algorithm. |
| string | signatureAlgorithm | The signature algorithm. |
| string | inclusiveNamespacesPrefixList | The inclusive namespace prefix list or |
| X509Certificate2 | x509Certificate | The X.509 certificate to include in the signature or |
Returns
| Type | Description |
|---|---|
| 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 |
|---|---|---|
| XmlElement | signedElement | The signed XML. |
| AsymmetricAlgorithm | verifyingKey | The verifying key. |
Returns
| Type | Description |
|---|---|
| bool |
|
Exceptions
| Type | Condition |
|---|---|
| SamlSignatureException | Thrown if an error occurs during signature verification. |