Show / Hide Table of Contents

Class RsaOaepXmlKeyEncryptionExtension

Supports the RSA-OAEP XML key encryption algorithms.

Inheritance
System.Object
RsaOaepXmlKeyEncryptionExtension
Implements
IXmlKeyEncryptionExtension
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 RsaOaepXmlKeyEncryptionExtension : IXmlKeyEncryptionExtension, IXmlEncryptionExtension
Remarks

The supported key encryption algorithms are:

  • http://www.w3.org/2009/xmlenc11#rsa-oaep

The algorithm http://www.w3.org/2009/xmlenc11#rsa-oaep uses the specified digest method and mask generation function.

The optional DigestMethod child element specifies the digest method. It defaults to SHA-1. The optional MGF child element specifies the mask generation function. It defaults to MGF1 with SHA-1.

NB. The .NET API has a restriction in that the digest method and MGF must use the same hash algorithm.

Methods

DecryptSymmetricKey(EncryptedKey, AsymmetricAlgorithm, String)

Decrypts the symmetric key using the specified asymmetric key and key encryption algorithm

Declaration
public byte[] DecryptSymmetricKey(EncryptedKey encryptedKey, AsymmetricAlgorithm keyDecryptingKey, string keyEncryptionAlgorithm)
Parameters
Type Name Description
System.Security.Cryptography.Xml.EncryptedKey encryptedKey

The encrypted symmetric key.

System.Security.Cryptography.AsymmetricAlgorithm keyDecryptingKey

The asymmetric key decrypting key.

System.String keyEncryptionAlgorithm

The key encryption algorithm.

Returns
Type Description
System.Byte[]

The decrypted symmetric key.

EncryptSymmetricKey(Byte[], AsymmetricAlgorithm, String, String, String)

Encrypts the symmetric key using the specified asymmetric key and key encryption algorithm.

Declaration
public byte[] EncryptSymmetricKey(byte[] symmetricKey, AsymmetricAlgorithm keyEncryptingKey, string keyEncryptionAlgorithm, string digestMethod, string maskGenerationFunction)
Parameters
Type Name Description
System.Byte[] symmetricKey

The symmetric key.

System.Security.Cryptography.AsymmetricAlgorithm keyEncryptingKey

The asymmetric key encrypting key.

System.String keyEncryptionAlgorithm

The key encryption algorithm.

System.String digestMethod

The digest method.

System.String maskGenerationFunction

The mask generation function.

Returns
Type Description
System.Byte[]

The encrypted symmetric key.

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.

Update(XmlElement, String, String, String)

Updates the encrypted data XML, if required.

Declaration
public void Update(XmlElement encryptedDataElement, string keyEncryptionAlgorithm, string digestMethod, string maskGenerationFunction)
Parameters
Type Name Description
System.Xml.XmlElement encryptedDataElement

The encrypted data XML.

System.String keyEncryptionAlgorithm

The key encryption algorithm.

System.String digestMethod

The digest method.

System.String maskGenerationFunction

The mask generation function.

Implements

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