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 |
System.Security.Cryptography.AsymmetricAlgorithm | keyDecryptingKey | The asymmetric key decrypting key. |
System.String | keyEncryptionAlgorithm | The key encryption algorithm or |
System.String | dataEncryptionAlgorithm | The data encryption algorithm or |
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 |
System.String | digestMethod | The digest method or |
System.String | maskGenerationFunction | The mask generation function or |
Returns
Type | Description |
---|---|
System.Xml.XmlElement | The encrypted XML. |
Exceptions
Type | Condition |
---|---|
SamlEncryptionException | Thrown if an error occurs during encryption. |