Class AesGcmXmlDataEncryptionExtension
- Namespace
- ComponentSpace.Saml2.XmlSecurity.Encryption
- Assembly
- ComponentSpace.Saml2.dll
Supports the AES-GCM XML data encryption algorithms.
public class AesGcmXmlDataEncryptionExtension : IXmlDataEncryptionExtension, IXmlEncryptionExtension
- Inheritance
-
AesGcmXmlDataEncryptionExtension
- Implements
- Inherited Members
Remarks
The supported data encryption algorithms are:
- http://www.w3.org/2009/xmlenc11#aes128-gcm
- http://www.w3.org/2009/xmlenc11#aes192-gcm
- http://www.w3.org/2009/xmlenc11#aes256-gcm
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.