Table of Contents

Interface IXmlEncryption

Namespace
ComponentSpace.Saml2.XmlSecurity.Encryption
Assembly
ComponentSpace.Saml2.dll

Supports XML encryption.

public interface IXmlEncryption

Methods

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

Decrypts the XML.

XmlElement Decrypt(XmlElement encryptedElement, IEnumerable<XmlElement> encryptedKeyElements, AsymmetricAlgorithm keyDecryptingKey, string keyEncryptionAlgorithm = null, string dataEncryptionAlgorithm = null)

Parameters

encryptedElement XmlElement

The encrypted XML.

encryptedKeyElements IEnumerable<XmlElement>

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

keyDecryptingKey AsymmetricAlgorithm

The asymmetric key decrypting key.

keyEncryptionAlgorithm string

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

dataEncryptionAlgorithm string

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

Returns

XmlElement

The plaintext XML.

Exceptions

SamlEncryptionException

Thrown if an error occurs during decryption.

Encrypt(XmlElement, AsymmetricAlgorithm, string, string, X509Certificate2, string, string)

Encrypts the XML.

XmlElement Encrypt(XmlElement plainTextElement, AsymmetricAlgorithm keyEncryptingKey, string keyEncryptionAlgorithm, string dataEncryptionAlgorithm, X509Certificate2 x509Certificate = null, string digestMethod = null, string maskGenerationFunction = null)

Parameters

plainTextElement XmlElement

The plaintext XML.

keyEncryptingKey AsymmetricAlgorithm

The asymmetric key encrypting key.

keyEncryptionAlgorithm string

The key encryption algorithm.

dataEncryptionAlgorithm string

The data encryption algorithm.

x509Certificate X509Certificate2

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

digestMethod string

The digest method or null if none.

maskGenerationFunction string

The mask generation function or null if none.

Returns

XmlElement

The encrypted XML.

Exceptions

SamlEncryptionException

Thrown if an error occurs during encryption.