Show / Hide Table of Contents

Class AesXmlDataEncryptionExtension

Supports the AES XML data encryption algorithms.

Inheritance
System.Object
AesXmlDataEncryptionExtension
Implements
IXmlDataEncryptionExtension
IXmlEncryptionExtension
Inherited Members
System.Object.Equals(System.Object)
System.Object.Equals(System.Object, System.Object)
System.Object.GetHashCode()
System.Object.GetType()
System.Object.MemberwiseClone()
System.Object.ReferenceEquals(System.Object, System.Object)
System.Object.ToString()
Namespace: ComponentSpace.Saml2.XmlSecurity.Encryption
Assembly: ComponentSpace.Saml2.dll
Syntax
public class AesXmlDataEncryptionExtension : IXmlDataEncryptionExtension, IXmlEncryptionExtension
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.

Declaration
public byte[] CreateSymmetricKey(string dataEncryptionAlgorithm)
Parameters
Type Name Description
System.String dataEncryptionAlgorithm

The data encryption algorithm.

Returns
Type Description
System.Byte[]

The symmetric key.

DecryptData(EncryptedData, Byte[], String)

Decrypts the data.

Declaration
public byte[] DecryptData(EncryptedData encryptedData, byte[] symmetricKey, string dataEncryptionAlgorithm)
Parameters
Type Name Description
System.Security.Cryptography.Xml.EncryptedData encryptedData

The encrypted data.

System.Byte[] symmetricKey

The decryption key.

System.String dataEncryptionAlgorithm

The data encryption algorithm.

Returns
Type Description
System.Byte[]

The decrypted data.

EncryptData(Byte[], Byte[], String)

Encrypts the data.

Declaration
public byte[] EncryptData(byte[] plainText, byte[] symmetricKey, string dataEncryptionAlgorithm)
Parameters
Type Name Description
System.Byte[] plainText

The data.

System.Byte[] symmetricKey

The encryption key.

System.String dataEncryptionAlgorithm

The data encryption algorithm.

Returns
Type Description
System.Byte[]

The encrypted data.

IsSupported(String)

Indicates whether the encryption algorithm is supported by this extension.

Declaration
public bool IsSupported(string encryptionAlgorithm)
Parameters
Type Name Description
System.String encryptionAlgorithm

The encryption algorithm.

Returns
Type Description
System.Boolean

true if the encryption algorithm is supported; otherwise false.

Implements

IXmlDataEncryptionExtension
IXmlEncryptionExtension
In This Article
Back to top Copyright © ComponentSpace Pty Ltd 2017-2022. All rights reserved.