Table of Contents

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

dataEncryptionAlgorithm string

The 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

encryptedData EncryptedData

The encrypted data.

symmetricKey byte[]

The decryption key.

dataEncryptionAlgorithm string

The 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

plainText byte[]

The data.

symmetricKey byte[]

The encryption key.

dataEncryptionAlgorithm string

The 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

encryptionAlgorithm string

The encryption algorithm.

Returns

bool

true if the encryption algorithm is supported; otherwise false.