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
encryptedElementXmlElementThe encrypted XML.
encryptedKeyElementsIEnumerable<XmlElement>The encrypted keys XML or
nullif included in the encrypted data.keyDecryptingKeyAsymmetricAlgorithmThe asymmetric key decrypting key.
keyEncryptionAlgorithmstringThe key encryption algorithm or
nullif specified in the encrypted key.dataEncryptionAlgorithmstringThe data encryption algorithm or
nullif 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
plainTextElementXmlElementThe plaintext XML.
keyEncryptingKeyAsymmetricAlgorithmThe asymmetric key encrypting key.
keyEncryptionAlgorithmstringThe key encryption algorithm.
dataEncryptionAlgorithmstringThe data encryption algorithm.
x509CertificateX509Certificate2The X.509 certificate to include in the encrypted data or
nullif none.digestMethodstringThe digest method or
nullif none.maskGenerationFunctionstringThe mask generation function or
nullif none.
Returns
- XmlElement
The encrypted XML.
Exceptions
- SamlEncryptionException
Thrown if an error occurs during encryption.