Class AesXmlDataEncryptionExtension
- Namespace
- ComponentSpace.Saml2.XmlSecurity.Encryption
- Assembly
- ComponentSpace.Saml2.dll
Supports the AES XML data encryption algorithms.
public class AesXmlDataEncryptionExtension : IXmlDataEncryptionExtension, IXmlEncryptionExtension
- Inheritance
-
AesXmlDataEncryptionExtension
- Implements
- Inherited Members
Remarks
The supported data encryption algorithms are:
- http://www.w3.org/2001/04/xmlenc#aes128-cbc
- http://www.w3.org/2001/04/xmlenc#kw-aes128
- http://www.w3.org/2001/04/xmlenc#aes192-cbc
- http://www.w3.org/2001/04/xmlenc#kw-aes192
- http://www.w3.org/2001/04/xmlenc#aes256-cbc
- http://www.w3.org/2001/04/xmlenc#kw-aes256
Methods
CreateSymmetricKey(string)
Creates a random symmetric key.
public byte[] CreateSymmetricKey(string dataEncryptionAlgorithm)
Parameters
dataEncryptionAlgorithmstringThe data encryption algorithm.
Returns
- byte[]
The symmetric key.
DecryptData(EncryptedData, byte[], string)
Decrypts the data.
public byte[] DecryptData(EncryptedData encryptedData, byte[] symmetricKey, string dataEncryptionAlgorithm)
Parameters
encryptedDataEncryptedDataThe encrypted data.
symmetricKeybyte[]The decryption key.
dataEncryptionAlgorithmstringThe data encryption algorithm.
Returns
- byte[]
The decrypted data.
EncryptData(byte[], byte[], string)
Encrypts the data.
public byte[] EncryptData(byte[] plainText, byte[] symmetricKey, string dataEncryptionAlgorithm)
Parameters
plainTextbyte[]The data.
symmetricKeybyte[]The encryption key.
dataEncryptionAlgorithmstringThe data encryption algorithm.
Returns
- byte[]
The encrypted data.
IsSupported(string)
Indicates whether the encryption algorithm is supported by this extension.
public bool IsSupported(string encryptionAlgorithm)
Parameters
encryptionAlgorithmstringThe encryption algorithm.
Returns
- bool
trueif the encryption algorithm is supported; otherwisefalse.