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 |
|---|---|---|
| XmlElement | encryptedElement | The encrypted XML. |
| IEnumerable<XmlElement> | encryptedKeyElements | The encrypted keys XML or |
| AsymmetricAlgorithm | keyDecryptingKey | The asymmetric key decrypting key. |
| string | keyEncryptionAlgorithm | The key encryption algorithm or |
| string | dataEncryptionAlgorithm | The data encryption algorithm or |
Returns
| Type | Description |
|---|---|
| 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 |
|---|---|---|
| XmlElement | plainTextElement | The plaintext XML. |
| AsymmetricAlgorithm | keyEncryptingKey | The asymmetric key encrypting key. |
| string | keyEncryptionAlgorithm | The key encryption algorithm. |
| string | dataEncryptionAlgorithm | The data encryption algorithm. |
| X509Certificate2 | x509Certificate | The X.509 certificate to include in the encrypted data or |
| string | digestMethod | The digest method or |
| string | maskGenerationFunction | The mask generation function or |
Returns
| Type | Description |
|---|---|
| XmlElement | The encrypted XML. |
Exceptions
| Type | Condition |
|---|---|
| SamlEncryptionException | Thrown if an error occurs during encryption. |