Show / Hide Table of Contents

Interface IXmlEncryption

Supports XML encryption.

Namespace: ComponentSpace.Saml2.XmlSecurity.Encryption
Assembly: ComponentSpace.Saml2.dll
Syntax
public interface IXmlEncryption

Methods

Decrypt(XmlElement, IEnumerable<XmlElement>, AsymmetricAlgorithm, String, String)

Decrypts the XML.

Declaration
XmlElement Decrypt(XmlElement encryptedElement, IEnumerable<XmlElement> encryptedKeyElements, AsymmetricAlgorithm keyDecryptingKey, string keyEncryptionAlgorithm = null, string dataEncryptionAlgorithm = null)
Parameters
Type Name Description
System.Xml.XmlElement encryptedElement

The encrypted XML.

System.Collections.Generic.IEnumerable<System.Xml.XmlElement> encryptedKeyElements

The encrypted keys XML or null if included in the encrypted data.

System.Security.Cryptography.AsymmetricAlgorithm keyDecryptingKey

The asymmetric key decrypting key.

System.String keyEncryptionAlgorithm

The key encryption algorithm or null if specified in the encrypted key.

System.String dataEncryptionAlgorithm

The data encryption algorithm or null if specified in the encrypted data.

Returns
Type Description
System.Xml.XmlElement

The plaintext XML.

Exceptions
Type Condition
SamlEncryptionException

Thrown if an error occurs during decryption.

Encrypt(XmlElement, AsymmetricAlgorithm, String, String, X509Certificate2, String, String)

Encrypts the XML.

Declaration
XmlElement Encrypt(XmlElement plainTextElement, AsymmetricAlgorithm keyEncryptingKey, string keyEncryptionAlgorithm, string dataEncryptionAlgorithm, X509Certificate2 x509Certificate = null, string digestMethod = null, string maskGenerationFunction = null)
Parameters
Type Name Description
System.Xml.XmlElement plainTextElement

The plaintext XML.

System.Security.Cryptography.AsymmetricAlgorithm keyEncryptingKey

The asymmetric key encrypting key.

System.String keyEncryptionAlgorithm

The key encryption algorithm.

System.String dataEncryptionAlgorithm

The data encryption algorithm.

System.Security.Cryptography.X509Certificates.X509Certificate2 x509Certificate

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

System.String digestMethod

The digest method or null if none.

System.String maskGenerationFunction

The mask generation function or null if none.

Returns
Type Description
System.Xml.XmlElement

The encrypted XML.

Exceptions
Type Condition
SamlEncryptionException

Thrown if an error occurs during encryption.

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