Show / Hide Table of Contents

Class EncryptedAssertion

Represents an encrypted assertion.

Inheritance
System.Object
EncryptedElementType
EncryptedAssertion
Inherited Members
EncryptedElementType.GetKeyInfo(XmlElement)
EncryptedElementType.GetCertificate(XmlElement)
EncryptedElementType.EncryptedData
EncryptedElementType.EncryptedKeys
EncryptedElementType.ToXml(XmlElement)
System.Object.ToString()
System.Object.Equals(System.Object)
System.Object.Equals(System.Object, System.Object)
System.Object.ReferenceEquals(System.Object, System.Object)
System.Object.GetHashCode()
System.Object.GetType()
System.Object.MemberwiseClone()
Namespace: ComponentSpace.SAML2.Assertions
Assembly: ComponentSpace.Saml2.dll
Syntax
public class EncryptedAssertion : EncryptedElementType
Remarks

Refer to the Assertions and Protocol for the OASIS Security Assertion Markup Language (SAML) V2.0 specification for further details.

Constructors

EncryptedAssertion()

Initializes a new instance of the EncryptedAssertion class.

Declaration
public EncryptedAssertion()

EncryptedAssertion(SAMLAssertion, AsymmetricAlgorithm, EncryptionMethod, EncryptionMethod, KeyInfo)

Initializes a new instance of the EncryptedAssertion class from a SAML assertion.

Declaration
public EncryptedAssertion(SAMLAssertion samlAssertion, AsymmetricAlgorithm keyEncryptingKey, EncryptionMethod keyEncryptionMethod, EncryptionMethod dataEncryptionMethod, KeyInfo keyInfo)
Parameters
Type Name Description
SAMLAssertion samlAssertion

The SAML assertion.

System.Security.Cryptography.AsymmetricAlgorithm keyEncryptingKey

The asymmetric key encrypting key.

System.Security.Cryptography.Xml.EncryptionMethod keyEncryptionMethod

The method for encrypting the symmetric key.

System.Security.Cryptography.Xml.EncryptionMethod dataEncryptionMethod

The method for encrypting the data.

System.Security.Cryptography.Xml.KeyInfo keyInfo

The key info to include with the encrypted data.

Remarks

A random symmetric session key is generated from the public asymmetric key. The symmetric key is used to encrypt the data.

The specified key encryption method is used. For example, http://www.w3.org/2001/04/xmlenc#rsa-oaep-mgf1p.

The specified data encryption method is used. For example, http://www.w3.org/2001/04/xmlenc#aes256-cbc.

The supported key encryption methods are:

  • http://www.w3.org/2001/04/xmlenc#rsa-1_5
  • http://www.w3.org/2001/04/xmlenc#rsa-oaep-mgf1p

The supported data encryption methods are:

  • http://www.w3.org/2001/04/xmlenc#tripledes-cbc
  • http://www.w3.org/2001/04/xmlenc#kw-tripledes
  • 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

Exceptions
Type Condition
SAMLEncryptionException

Thrown when the encryption fails.

EncryptedAssertion(SAMLAssertion, AsymmetricAlgorithm, EncryptionMethod, EncryptionMethod, String, String, KeyInfo)

Initializes a new instance of the EncryptedAssertion class from a SAML assertion.

Declaration
public EncryptedAssertion(SAMLAssertion samlAssertion, AsymmetricAlgorithm keyEncryptingKey, EncryptionMethod keyEncryptionMethod, EncryptionMethod dataEncryptionMethod, string digestMethod, string maskGenerationFunction, KeyInfo keyInfo)
Parameters
Type Name Description
SAMLAssertion samlAssertion

The SAML assertion.

System.Security.Cryptography.AsymmetricAlgorithm keyEncryptingKey

The asymmetric key encrypting key.

System.Security.Cryptography.Xml.EncryptionMethod keyEncryptionMethod

The method for encrypting the symmetric key.

System.Security.Cryptography.Xml.EncryptionMethod dataEncryptionMethod

The method for encrypting the data.

System.String digestMethod

The key encryption digest method or null.

System.String maskGenerationFunction

The key encryption mask generation function or null.

System.Security.Cryptography.Xml.KeyInfo keyInfo

The key info to include with the encrypted data.

Remarks

A random symmetric session key is generated from the public asymmetric key. The symmetric key is used to encrypt the data.

The specified key encryption method is used. For example, http://www.w3.org/2001/04/xmlenc#rsa-oaep-mgf1p.

The specified data encryption method is used. For example, http://www.w3.org/2001/04/xmlenc#aes256-cbc.

The supported key encryption methods are:

  • http://www.w3.org/2001/04/xmlenc#rsa-1_5
  • http://www.w3.org/2001/04/xmlenc#rsa-oaep-mgf1p

The supported data encryption methods are:

  • http://www.w3.org/2001/04/xmlenc#tripledes-cbc
  • http://www.w3.org/2001/04/xmlenc#kw-tripledes
  • 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

Exceptions
Type Condition
SAMLEncryptionException

Thrown when the encryption fails.

EncryptedAssertion(SAMLAssertion, AsymmetricAlgorithm, EncryptionMethod, KeyInfo)

Initializes a new instance of the EncryptedAssertion class from a SAML assertion.

Declaration
public EncryptedAssertion(SAMLAssertion samlAssertion, AsymmetricAlgorithm keyEncryptingKey, EncryptionMethod dataEncryptionMethod, KeyInfo keyInfo)
Parameters
Type Name Description
SAMLAssertion samlAssertion

The SAML assertion.

System.Security.Cryptography.AsymmetricAlgorithm keyEncryptingKey

The asymmetric key encrypting key.

System.Security.Cryptography.Xml.EncryptionMethod dataEncryptionMethod

The method for encrypting the data.

System.Security.Cryptography.Xml.KeyInfo keyInfo

The key info to include with the encrypted data.

Remarks

A random symmetric session key is generated from the public asymmetric key. The symmetric key is used to encrypt the data.

The encryption method for the encrypted symmetric key is http://www.w3.org/2001/04/xmlenc#rsa-oaep-mgf1p.

The specified data encryption method is used. For example, http://www.w3.org/2001/04/xmlenc#aes256-cbc.

The supported data encryption methods are:

  • http://www.w3.org/2001/04/xmlenc#tripledes-cbc
  • http://www.w3.org/2001/04/xmlenc#kw-tripledes
  • 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

Exceptions
Type Condition
SAMLEncryptionException

Thrown when the encryption fails.

EncryptedAssertion(SAMLAssertion, AsymmetricAlgorithm, KeyInfo)

Initializes a new instance of the EncryptedAssertion class from a SAML assertion.

Declaration
public EncryptedAssertion(SAMLAssertion samlAssertion, AsymmetricAlgorithm keyEncryptingKey, KeyInfo keyInfo)
Parameters
Type Name Description
SAMLAssertion samlAssertion

The SAML assertion.

System.Security.Cryptography.AsymmetricAlgorithm keyEncryptingKey

The asymmetric key encrypting key.

System.Security.Cryptography.Xml.KeyInfo keyInfo

The key info to include with the encrypted data.

Remarks

A random symmetric session key is generated from the public asymmetric key. The symmetric key is used to encrypt the data.

The encryption method for the encrypted symmetric key is http://www.w3.org/2001/04/xmlenc#rsa-oaep-mgf1p.

The encryption method for the data is http://www.w3.org/2001/04/xmlenc#aes256-cbc.

Exceptions
Type Condition
SAMLEncryptionException

Thrown when the encryption fails.

EncryptedAssertion(SAMLAssertion, X509Certificate2)

Initializes a new instance of the EncryptedAssertion class from a SAML assertion.

Declaration
public EncryptedAssertion(SAMLAssertion samlAssertion, X509Certificate2 x509Certificate)
Parameters
Type Name Description
SAMLAssertion samlAssertion

The SAML assertion.

System.Security.Cryptography.X509Certificates.X509Certificate2 x509Certificate

The X.509 certificate used when encrypting the data.

Remarks

A random symmetric session key is generated from the public key contained within the X.509 certificate. The symmetric key is used to encrypt the data.

The encryption method for the encrypted symmetric key is http://www.w3.org/2001/04/xmlenc#rsa-oaep-mgf1p.

The encryption method for the data is http://www.w3.org/2001/04/xmlenc#aes256-cbc.

Exceptions
Type Condition
SAMLSerializationException

Thrown when the XML deserialization fails.

SAMLEncryptionException

Thrown when the encryption fails.

See Also
Decrypt(AsymmetricAlgorithm, EncryptionMethod, EncryptionMethod)
Decrypt(X509Certificate2, EncryptionMethod, EncryptionMethod)

EncryptedAssertion(SAMLAssertion, X509Certificate2, EncryptionMethod)

Initializes a new instance of the EncryptedAssertion class from a SAML assertion.

Declaration
public EncryptedAssertion(SAMLAssertion samlAssertion, X509Certificate2 x509Certificate, EncryptionMethod dataEncryptionMethod)
Parameters
Type Name Description
SAMLAssertion samlAssertion

The SAML assertion.

System.Security.Cryptography.X509Certificates.X509Certificate2 x509Certificate

The X.509 certificate used when encrypting the data.

System.Security.Cryptography.Xml.EncryptionMethod dataEncryptionMethod

The method for encrypting the data.

Remarks

A random symmetric session key is generated from the public key contained within the X.509 certificate. The symmetric key is used to encrypt the data.

The encryption method for the encrypted symmetric key is http://www.w3.org/2001/04/xmlenc#rsa-oaep-mgf1p.

The specified data encryption method is used. For example, http://www.w3.org/2001/04/xmlenc#aes256-cbc.

The supported data encryption methods are:

  • http://www.w3.org/2001/04/xmlenc#tripledes-cbc
  • http://www.w3.org/2001/04/xmlenc#kw-tripledes
  • 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

Exceptions
Type Condition
SAMLSerializationException

Thrown when the XML deserialization fails.

SAMLEncryptionException

Thrown when the encryption fails.

See Also
Decrypt(AsymmetricAlgorithm, EncryptionMethod, EncryptionMethod)
Decrypt(X509Certificate2, EncryptionMethod, EncryptionMethod)

EncryptedAssertion(SAMLAssertion, X509Certificate2, EncryptionMethod, EncryptionMethod)

Initializes a new instance of the EncryptedAssertion class from a SAML assertion.

Declaration
public EncryptedAssertion(SAMLAssertion samlAssertion, X509Certificate2 x509Certificate, EncryptionMethod keyEncryptionMethod, EncryptionMethod dataEncryptionMethod)
Parameters
Type Name Description
SAMLAssertion samlAssertion

The SAML assertion.

System.Security.Cryptography.X509Certificates.X509Certificate2 x509Certificate

The X.509 certificate used when encrypting the data.

System.Security.Cryptography.Xml.EncryptionMethod keyEncryptionMethod

The method for encrypting the symmetric key.

System.Security.Cryptography.Xml.EncryptionMethod dataEncryptionMethod

The method for encrypting the data.

Remarks

A random symmetric session key is generated from the public key contained within the X.509 certificate. The symmetric key is used to encrypt the data.

The specified key encryption method is used. For example, http://www.w3.org/2001/04/xmlenc#rsa-oaep-mgf1p.

The specified data encryption method is used. For example, http://www.w3.org/2001/04/xmlenc#aes256-cbc.

The supported key encryption methods are:

  • http://www.w3.org/2001/04/xmlenc#rsa-1_5
  • http://www.w3.org/2001/04/xmlenc#rsa-oaep-mgf1p

The supported data encryption methods are:

  • http://www.w3.org/2001/04/xmlenc#tripledes-cbc
  • http://www.w3.org/2001/04/xmlenc#kw-tripledes
  • 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

Exceptions
Type Condition
SAMLSerializationException

Thrown when the XML deserialization fails.

SAMLEncryptionException

Thrown when the encryption fails.

See Also
Decrypt(AsymmetricAlgorithm, EncryptionMethod, EncryptionMethod)
Decrypt(X509Certificate2, EncryptionMethod, EncryptionMethod)

EncryptedAssertion(SAMLAssertion, X509Certificate2, EncryptionMethod, EncryptionMethod, String, String)

Initializes a new instance of the EncryptedAssertion class from a SAML assertion.

Declaration
public EncryptedAssertion(SAMLAssertion samlAssertion, X509Certificate2 x509Certificate, EncryptionMethod keyEncryptionMethod, EncryptionMethod dataEncryptionMethod, string digestMethod, string maskGenerationFunction)
Parameters
Type Name Description
SAMLAssertion samlAssertion

The SAML assertion.

System.Security.Cryptography.X509Certificates.X509Certificate2 x509Certificate

The X.509 certificate used when encrypting the data.

System.Security.Cryptography.Xml.EncryptionMethod keyEncryptionMethod

The method for encrypting the symmetric key.

System.Security.Cryptography.Xml.EncryptionMethod dataEncryptionMethod

The method for encrypting the data.

System.String digestMethod

The key encryption digest method or null.

System.String maskGenerationFunction

The key encryption mask generation function or null.

Remarks

A random symmetric session key is generated from the public key contained within the X.509 certificate. The symmetric key is used to encrypt the data.

The specified key encryption method is used. For example, http://www.w3.org/2001/04/xmlenc#rsa-oaep-mgf1p.

The specified data encryption method is used. For example, http://www.w3.org/2001/04/xmlenc#aes256-cbc.

The supported key encryption methods are:

  • http://www.w3.org/2001/04/xmlenc#rsa-1_5
  • http://www.w3.org/2001/04/xmlenc#rsa-oaep-mgf1p

The supported data encryption methods are:

  • http://www.w3.org/2001/04/xmlenc#tripledes-cbc
  • http://www.w3.org/2001/04/xmlenc#kw-tripledes
  • 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

Exceptions
Type Condition
SAMLSerializationException

Thrown when the XML deserialization fails.

SAMLEncryptionException

Thrown when the encryption fails.

See Also
Decrypt(AsymmetricAlgorithm, EncryptionMethod, EncryptionMethod)
Decrypt(X509Certificate2, EncryptionMethod, EncryptionMethod)

EncryptedAssertion(XmlElement)

Initializes a new instance of the EncryptedAssertion class from XML.

Declaration
public EncryptedAssertion(XmlElement xmlElement)
Parameters
Type Name Description
System.Xml.XmlElement xmlElement

The encrypted assertion XML.

Exceptions
Type Condition
SAMLSerializationException

Thrown when the XML deserialization fails.

EncryptedAssertion(XmlElement, AsymmetricAlgorithm, EncryptionMethod, EncryptionMethod, KeyInfo)

Initializes a new instance of the EncryptedAssertion class from a SAML assertion XML.

Declaration
public EncryptedAssertion(XmlElement samlAssertion, AsymmetricAlgorithm keyEncryptingKey, EncryptionMethod keyEncryptionMethod, EncryptionMethod dataEncryptionMethod, KeyInfo keyInfo)
Parameters
Type Name Description
System.Xml.XmlElement samlAssertion

The SAML assertion XML.

System.Security.Cryptography.AsymmetricAlgorithm keyEncryptingKey

The asymmetric key encrypting key.

System.Security.Cryptography.Xml.EncryptionMethod keyEncryptionMethod

The method for encrypting the symmetric key.

System.Security.Cryptography.Xml.EncryptionMethod dataEncryptionMethod

The method for encrypting the data.

System.Security.Cryptography.Xml.KeyInfo keyInfo

The key info to include with the encrypted data.

Remarks

A random symmetric session key is generated from the public asymmetric key. The symmetric key is used to encrypt the data.

The specified key encryption method is used. For example, http://www.w3.org/2001/04/xmlenc#rsa-oaep-mgf1p.

The specified data encryption method is used. For example, http://www.w3.org/2001/04/xmlenc#aes256-cbc.

The supported key encryption methods are:

  • http://www.w3.org/2001/04/xmlenc#rsa-1_5
  • http://www.w3.org/2001/04/xmlenc#rsa-oaep-mgf1p

The supported data encryption methods are:

  • http://www.w3.org/2001/04/xmlenc#tripledes-cbc
  • http://www.w3.org/2001/04/xmlenc#kw-tripledes
  • 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

Exceptions
Type Condition
SAMLEncryptionException

Thrown when the encryption fails.

EncryptedAssertion(XmlElement, AsymmetricAlgorithm, EncryptionMethod, EncryptionMethod, String, String, KeyInfo)

Initializes a new instance of the EncryptedAssertion class from a SAML assertion XML.

Declaration
public EncryptedAssertion(XmlElement samlAssertion, AsymmetricAlgorithm keyEncryptingKey, EncryptionMethod keyEncryptionMethod, EncryptionMethod dataEncryptionMethod, string digestMethod, string maskGenerationFunction, KeyInfo keyInfo)
Parameters
Type Name Description
System.Xml.XmlElement samlAssertion

The SAML assertion XML.

System.Security.Cryptography.AsymmetricAlgorithm keyEncryptingKey

The asymmetric key encrypting key.

System.Security.Cryptography.Xml.EncryptionMethod keyEncryptionMethod

The method for encrypting the symmetric key.

System.Security.Cryptography.Xml.EncryptionMethod dataEncryptionMethod

The method for encrypting the data.

System.String digestMethod

The key encryption digest method or null.

System.String maskGenerationFunction

The key encryption mask generation function or null.

System.Security.Cryptography.Xml.KeyInfo keyInfo

The key info to include with the encrypted data.

Remarks

A random symmetric session key is generated from the public asymmetric key. The symmetric key is used to encrypt the data.

The specified key encryption method is used. For example, http://www.w3.org/2001/04/xmlenc#rsa-oaep-mgf1p.

The specified data encryption method is used. For example, http://www.w3.org/2001/04/xmlenc#aes256-cbc.

The supported key encryption methods are:

  • http://www.w3.org/2001/04/xmlenc#rsa-1_5
  • http://www.w3.org/2001/04/xmlenc#rsa-oaep-mgf1p

The supported data encryption methods are:

  • http://www.w3.org/2001/04/xmlenc#tripledes-cbc
  • http://www.w3.org/2001/04/xmlenc#kw-tripledes
  • 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

Exceptions
Type Condition
SAMLEncryptionException

Thrown when the encryption fails.

EncryptedAssertion(XmlElement, AsymmetricAlgorithm, EncryptionMethod, KeyInfo)

Initializes a new instance of the EncryptedAssertion class from a SAML assertion XML.

Declaration
public EncryptedAssertion(XmlElement samlAssertion, AsymmetricAlgorithm keyEncryptingKey, EncryptionMethod dataEncryptionMethod, KeyInfo keyInfo)
Parameters
Type Name Description
System.Xml.XmlElement samlAssertion

The SAML assertion XML.

System.Security.Cryptography.AsymmetricAlgorithm keyEncryptingKey

The asymmetric key encrypting key.

System.Security.Cryptography.Xml.EncryptionMethod dataEncryptionMethod

The method for encrypting the data.

System.Security.Cryptography.Xml.KeyInfo keyInfo

The key info to include with the encrypted data.

Remarks

A random symmetric session key is generated from the public asymmetric key. The symmetric key is used to encrypt the data.

The encryption method for the encrypted symmetric key is http://www.w3.org/2001/04/xmlenc#rsa-oaep-mgf1p.

The specified data encryption method is used. For example, http://www.w3.org/2001/04/xmlenc#aes256-cbc.

Exceptions
Type Condition
SAMLEncryptionException

Thrown when the encryption fails.

EncryptedAssertion(XmlElement, AsymmetricAlgorithm, KeyInfo)

Initializes a new instance of the EncryptedAssertion class from a SAML assertion XML.

Declaration
public EncryptedAssertion(XmlElement samlAssertion, AsymmetricAlgorithm keyEncryptingKey, KeyInfo keyInfo)
Parameters
Type Name Description
System.Xml.XmlElement samlAssertion

The SAML assertion XML.

System.Security.Cryptography.AsymmetricAlgorithm keyEncryptingKey

The asymmetric key encrypting key.

System.Security.Cryptography.Xml.KeyInfo keyInfo

The key info to include with the encrypted data.

Remarks

A random symmetric session key is generated from the public asymmetric key. The symmetric key is used to encrypt the data.

The encryption method for the encrypted symmetric key is http://www.w3.org/2001/04/xmlenc#rsa-oaep-mgf1p.

The encryption method for the data is http://www.w3.org/2001/04/xmlenc#aes256-cbc.

Exceptions
Type Condition
SAMLEncryptionException

Thrown when the encryption fails.

EncryptedAssertion(XmlElement, X509Certificate2)

Initializes a new instance of the EncryptedAssertion class from a SAML assertion XML.

Declaration
public EncryptedAssertion(XmlElement samlAssertion, X509Certificate2 x509Certificate)
Parameters
Type Name Description
System.Xml.XmlElement samlAssertion

The SAML assertion XML.

System.Security.Cryptography.X509Certificates.X509Certificate2 x509Certificate

The X.509 certificate used when encrypting the data.

Remarks

A random symmetric session key is generated from the public key contained within the X.509 certificate. The symmetric key is used to encrypt the data.

The encryption method for the encrypted symmetric key is http://www.w3.org/2001/04/xmlenc#rsa-oaep-mgf1p.

The encryption method for the data is http://www.w3.org/2001/04/xmlenc#aes256-cbc.

Exceptions
Type Condition
SAMLEncryptionException

Thrown when the encryption fails.

See Also
Decrypt(AsymmetricAlgorithm, EncryptionMethod, EncryptionMethod)
Decrypt(X509Certificate2, EncryptionMethod, EncryptionMethod)

EncryptedAssertion(XmlElement, X509Certificate2, EncryptionMethod)

Initializes a new instance of the EncryptedAssertion class from a SAML assertion XML.

Declaration
public EncryptedAssertion(XmlElement samlAssertion, X509Certificate2 x509Certificate, EncryptionMethod dataEncryptionMethod)
Parameters
Type Name Description
System.Xml.XmlElement samlAssertion

The SAML assertion XML.

System.Security.Cryptography.X509Certificates.X509Certificate2 x509Certificate

The X.509 certificate used when encrypting the data.

System.Security.Cryptography.Xml.EncryptionMethod dataEncryptionMethod

The method for encrypting the data.

Remarks

A random symmetric session key is generated from the public key contained within the X.509 certificate. The symmetric key is used to encrypt the data.

The encryption method for the encrypted symmetric key is http://www.w3.org/2001/04/xmlenc#rsa-oaep-mgf1p.

The specified data encryption method is used. For example, http://www.w3.org/2001/04/xmlenc#aes256-cbc.

The supported data encryption methods are:

  • http://www.w3.org/2001/04/xmlenc#tripledes-cbc
  • http://www.w3.org/2001/04/xmlenc#kw-tripledes
  • 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

Exceptions
Type Condition
SAMLEncryptionException

Thrown when the encryption fails.

See Also
Decrypt(AsymmetricAlgorithm, EncryptionMethod, EncryptionMethod)
Decrypt(X509Certificate2, EncryptionMethod, EncryptionMethod)

EncryptedAssertion(XmlElement, X509Certificate2, EncryptionMethod, EncryptionMethod)

Initializes a new instance of the EncryptedAssertion class from a SAML assertion XML.

Declaration
public EncryptedAssertion(XmlElement samlAssertion, X509Certificate2 x509Certificate, EncryptionMethod keyEncryptionMethod, EncryptionMethod dataEncryptionMethod)
Parameters
Type Name Description
System.Xml.XmlElement samlAssertion

The SAML assertion XML.

System.Security.Cryptography.X509Certificates.X509Certificate2 x509Certificate

The X.509 certificate used when encrypting the data.

System.Security.Cryptography.Xml.EncryptionMethod keyEncryptionMethod

The method for encrypting the symmetric key.

System.Security.Cryptography.Xml.EncryptionMethod dataEncryptionMethod

The method for encrypting the data.

Remarks

A random symmetric session key is generated from the public key contained within the X.509 certificate. The symmetric key is used to encrypt the data.

The specified key encryption method is used. For example, http://www.w3.org/2001/04/xmlenc#rsa-oaep-mgf1p.

The specified data encryption method is used. For example, http://www.w3.org/2001/04/xmlenc#aes256-cbc.

The supported key encryption methods are:

  • http://www.w3.org/2001/04/xmlenc#rsa-1_5
  • http://www.w3.org/2001/04/xmlenc#rsa-oaep-mgf1p

The supported data encryption methods are:

  • http://www.w3.org/2001/04/xmlenc#tripledes-cbc
  • http://www.w3.org/2001/04/xmlenc#kw-tripledes
  • 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

Exceptions
Type Condition
SAMLEncryptionException

Thrown when the encryption fails.

See Also
Decrypt(AsymmetricAlgorithm, EncryptionMethod, EncryptionMethod)
Decrypt(X509Certificate2, EncryptionMethod, EncryptionMethod)

EncryptedAssertion(XmlElement, X509Certificate2, EncryptionMethod, EncryptionMethod, String, String)

Initializes a new instance of the EncryptedAssertion class from a SAML assertion XML.

Declaration
public EncryptedAssertion(XmlElement samlAssertion, X509Certificate2 x509Certificate, EncryptionMethod keyEncryptionMethod, EncryptionMethod dataEncryptionMethod, string digestMethod, string maskGenerationFunction)
Parameters
Type Name Description
System.Xml.XmlElement samlAssertion

The SAML assertion XML.

System.Security.Cryptography.X509Certificates.X509Certificate2 x509Certificate

The X.509 certificate used when encrypting the data.

System.Security.Cryptography.Xml.EncryptionMethod keyEncryptionMethod

The method for encrypting the symmetric key.

System.Security.Cryptography.Xml.EncryptionMethod dataEncryptionMethod

The method for encrypting the data.

System.String digestMethod

The key encryption digest method or null.

System.String maskGenerationFunction

The key encryption mask generation function or null.

Remarks

A random symmetric session key is generated from the public key contained within the X.509 certificate. The symmetric key is used to encrypt the data.

The specified key encryption method is used. For example, http://www.w3.org/2001/04/xmlenc#rsa-oaep-mgf1p.

The specified data encryption method is used. For example, http://www.w3.org/2001/04/xmlenc#aes256-cbc.

The supported key encryption methods are:

  • http://www.w3.org/2001/04/xmlenc#rsa-1_5
  • http://www.w3.org/2001/04/xmlenc#rsa-oaep-mgf1p

The supported data encryption methods are:

  • http://www.w3.org/2001/04/xmlenc#tripledes-cbc
  • http://www.w3.org/2001/04/xmlenc#kw-tripledes
  • 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

Exceptions
Type Condition
SAMLEncryptionException

Thrown when the encryption fails.

See Also
Decrypt(AsymmetricAlgorithm, EncryptionMethod, EncryptionMethod)
Decrypt(X509Certificate2, EncryptionMethod, EncryptionMethod)

EncryptedAssertion(XmlElement, XmlNodeList)

Initializes a new instance of the EncryptedAssertion class.

Declaration
public EncryptedAssertion(XmlElement encryptedData, XmlNodeList encryptedKeys)
Parameters
Type Name Description
System.Xml.XmlElement encryptedData

The encrypted data.

System.Xml.XmlNodeList encryptedKeys

The encrypted keys.

Methods

Decrypt(AsymmetricAlgorithm)

Decrypts an encrypted assertion.

Declaration
public SAMLAssertion Decrypt(AsymmetricAlgorithm keyDecryptingKey)
Parameters
Type Name Description
System.Security.Cryptography.AsymmetricAlgorithm keyDecryptingKey

The asymmetric key decrypting key.

Returns
Type Description
SAMLAssertion

The SAML assertion.

Remarks

The asymmetric key is used to decrypt the symmetric key contained within the encrypted data. The symmetric key is used to decrypt the data.

The encryption method for the encrypted symmetric key is expected to be http://www.w3.org/2001/04/xmlenc#rsa-1_5 or http://www.w3.org/2001/04/xmlenc#rsa-oaep-mgf1p.

The encryption method for the data is specified in the encrypted data.

DecryptToXml should be used if the assertion includes a signature to be verified.

The supported key encryption methods are:

  • http://www.w3.org/2001/04/xmlenc#rsa-1_5
  • http://www.w3.org/2001/04/xmlenc#rsa-oaep-mgf1p

The supported data encryption methods are:

  • http://www.w3.org/2001/04/xmlenc#tripledes-cbc
  • http://www.w3.org/2001/04/xmlenc#kw-tripledes
  • 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

Exceptions
Type Condition
SAMLSerializationException

Thrown when the XML deserialization fails.

SAMLEncryptionException

Thrown when the decryption fails.

See Also
EncryptedAssertion(SAMLAssertion, X509Certificate2, EncryptionMethod, EncryptionMethod)

Decrypt(AsymmetricAlgorithm, EncryptionMethod)

Decrypts an encrypted assertion.

Declaration
public SAMLAssertion Decrypt(AsymmetricAlgorithm keyDecryptingKey, EncryptionMethod dataEncryptionMethod)
Parameters
Type Name Description
System.Security.Cryptography.AsymmetricAlgorithm keyDecryptingKey

The asymmetric key decrypting key.

System.Security.Cryptography.Xml.EncryptionMethod dataEncryptionMethod

The method for decrypting the data or null if specified in the encrypted data.

Returns
Type Description
SAMLAssertion

The SAML assertion.

Remarks

The asymmetric key is used to decrypt the symmetric key contained within the encrypted data. The symmetric key is used to decrypt the data.

The encryption method for the encrypted symmetric key is expected to be http://www.w3.org/2001/04/xmlenc#rsa-1_5 or http://www.w3.org/2001/04/xmlenc#rsa-oaep-mgf1p.

The encryption method for the data is specified in the encrypted data or may be explicitly specified.

DecryptToXml should be used if the assertion includes a signature to be verified.

The supported key encryption methods are:

  • http://www.w3.org/2001/04/xmlenc#rsa-1_5
  • http://www.w3.org/2001/04/xmlenc#rsa-oaep-mgf1p

The supported data encryption methods are:

  • http://www.w3.org/2001/04/xmlenc#tripledes-cbc
  • http://www.w3.org/2001/04/xmlenc#kw-tripledes
  • 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

Exceptions
Type Condition
SAMLSerializationException

Thrown when the XML deserialization fails.

SAMLEncryptionException

Thrown when the decryption fails.

See Also
EncryptedAssertion(SAMLAssertion, X509Certificate2, EncryptionMethod, EncryptionMethod)

Decrypt(AsymmetricAlgorithm, EncryptionMethod, EncryptionMethod)

Decrypts an encrypted assertion.

Declaration
public SAMLAssertion Decrypt(AsymmetricAlgorithm keyDecryptingKey, EncryptionMethod keyEncryptionMethod, EncryptionMethod dataEncryptionMethod)
Parameters
Type Name Description
System.Security.Cryptography.AsymmetricAlgorithm keyDecryptingKey

The asymmetric key decrypting key.

System.Security.Cryptography.Xml.EncryptionMethod keyEncryptionMethod

The method for decrypting the symmetric key or null if specified in the encrypted key.

System.Security.Cryptography.Xml.EncryptionMethod dataEncryptionMethod

The method for decrypting the data or null if specified in the encrypted data.

Returns
Type Description
SAMLAssertion

The SAML assertion.

Remarks

The asymmetric key is used to decrypt the symmetric key contained within the encrypted data. The symmetric key is used to decrypt the data.

The encryption method for the encrypted symmetric key is expected to be http://www.w3.org/2001/04/xmlenc#rsa-1_5 or http://www.w3.org/2001/04/xmlenc#rsa-oaep-mgf1p.

The encryption method for the key is specified in the encrypted data or may be explicitly specified.

The encryption method for the data is specified in the encrypted data or may be explicitly specified.

DecryptToXml should be used if the assertion includes a signature to be verified.

The supported key encryption methods are:

  • http://www.w3.org/2001/04/xmlenc#rsa-1_5
  • http://www.w3.org/2001/04/xmlenc#rsa-oaep-mgf1p

The supported data encryption methods are:

  • http://www.w3.org/2001/04/xmlenc#tripledes-cbc
  • http://www.w3.org/2001/04/xmlenc#kw-tripledes
  • 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

Exceptions
Type Condition
SAMLSerializationException

Thrown when the XML deserialization fails.

SAMLEncryptionException

Thrown when the decryption fails.

See Also
EncryptedAssertion(SAMLAssertion, X509Certificate2, EncryptionMethod, EncryptionMethod)

Decrypt(X509Certificate2)

Decrypts an encrypted assertion.

Declaration
public SAMLAssertion Decrypt(X509Certificate2 x509Certificate)
Parameters
Type Name Description
System.Security.Cryptography.X509Certificates.X509Certificate2 x509Certificate

The X.509 certificate containing a private key.

Returns
Type Description
SAMLAssertion

The SAML assertion.

Remarks

The X.509 certificate's private key is used to decrypt the symmetric key contained within the encrypted data. The symmetric key is used to decrypt the data.

The encryption method for the encrypted symmetric key is expected to be http://www.w3.org/2001/04/xmlenc#rsa-1_5 or http://www.w3.org/2001/04/xmlenc#rsa-oaep-mgf1p.

The encryption method for the data is specified in the encrypted data.

DecryptToXml should be used if the assertion includes a signature to be verified.

The supported key encryption methods are:

  • http://www.w3.org/2001/04/xmlenc#rsa-1_5
  • http://www.w3.org/2001/04/xmlenc#rsa-oaep-mgf1p

The supported data encryption methods are:

  • http://www.w3.org/2001/04/xmlenc#tripledes-cbc
  • http://www.w3.org/2001/04/xmlenc#kw-tripledes
  • 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

Exceptions
Type Condition
SAMLSerializationException

Thrown when the XML deserialization fails.

SAMLEncryptionException

Thrown when the decryption fails.

See Also
EncryptedAssertion(SAMLAssertion, X509Certificate2, EncryptionMethod)

Decrypt(X509Certificate2, EncryptionMethod)

Decrypts an encrypted assertion.

Declaration
public SAMLAssertion Decrypt(X509Certificate2 x509Certificate, EncryptionMethod dataEncryptionMethod)
Parameters
Type Name Description
System.Security.Cryptography.X509Certificates.X509Certificate2 x509Certificate

The X.509 certificate containing a private key.

System.Security.Cryptography.Xml.EncryptionMethod dataEncryptionMethod

The method for decrypting the data or null if specified in the encrypted data.

Returns
Type Description
SAMLAssertion

The SAML assertion.

Remarks

The X.509 certificate's private key is used to decrypt the symmetric key contained within the encrypted data. The symmetric key is used to decrypt the data.

The encryption method for the encrypted symmetric key is expected to be http://www.w3.org/2001/04/xmlenc#rsa-1_5 or http://www.w3.org/2001/04/xmlenc#rsa-oaep-mgf1p.

The encryption method for the data is specified in the encrypted data or may be explicitly specified.

DecryptToXml should be used if the assertion includes a signature to be verified.

The supported key encryption methods are:

  • http://www.w3.org/2001/04/xmlenc#rsa-1_5
  • http://www.w3.org/2001/04/xmlenc#rsa-oaep-mgf1p

The supported data encryption methods are:

  • http://www.w3.org/2001/04/xmlenc#tripledes-cbc
  • http://www.w3.org/2001/04/xmlenc#kw-tripledes
  • 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

Exceptions
Type Condition
SAMLSerializationException

Thrown when the XML deserialization fails.

SAMLEncryptionException

Thrown when the decryption fails.

See Also
EncryptedAssertion(SAMLAssertion, X509Certificate2, EncryptionMethod)

Decrypt(X509Certificate2, EncryptionMethod, EncryptionMethod)

Decrypts an encrypted assertion.

Declaration
public SAMLAssertion Decrypt(X509Certificate2 x509Certificate, EncryptionMethod keyEncryptionMethod, EncryptionMethod dataEncryptionMethod)
Parameters
Type Name Description
System.Security.Cryptography.X509Certificates.X509Certificate2 x509Certificate

The X.509 certificate containing a private key.

System.Security.Cryptography.Xml.EncryptionMethod keyEncryptionMethod

The method for decrypting the symmetric key or null if specified in the encrypted key.

System.Security.Cryptography.Xml.EncryptionMethod dataEncryptionMethod

The method for decrypting the data or null if specified in the encrypted data.

Returns
Type Description
SAMLAssertion

The SAML assertion.

Remarks

The X.509 certificate's private key is used to decrypt the symmetric key contained within the encrypted data. The symmetric key is used to decrypt the data.

The encryption method for the encrypted symmetric key is expected to be http://www.w3.org/2001/04/xmlenc#rsa-1_5 or http://www.w3.org/2001/04/xmlenc#rsa-oaep-mgf1p.

The encryption method for the key is specified in the encrypted data or may be explicitly specified.

The encryption method for the data is specified in the encrypted data or may be explicitly specified.

DecryptToXml should be used if the assertion includes a signature to be verified.

The supported key encryption methods are:

  • http://www.w3.org/2001/04/xmlenc#rsa-1_5
  • http://www.w3.org/2001/04/xmlenc#rsa-oaep-mgf1p

The supported data encryption methods are:

  • http://www.w3.org/2001/04/xmlenc#tripledes-cbc
  • http://www.w3.org/2001/04/xmlenc#kw-tripledes
  • 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

Exceptions
Type Condition
SAMLSerializationException

Thrown when the XML deserialization fails.

SAMLEncryptionException

Thrown when the decryption fails.

See Also
EncryptedAssertion(SAMLAssertion, X509Certificate2, EncryptionMethod)

DecryptToXml(AsymmetricAlgorithm)

Decrypts an encrypted assertion to XML.

Declaration
public XmlElement DecryptToXml(AsymmetricAlgorithm keyDecryptingKey)
Parameters
Type Name Description
System.Security.Cryptography.AsymmetricAlgorithm keyDecryptingKey

The asymmetric key decrypting key.

Returns
Type Description
System.Xml.XmlElement

The SAML assertion XML.

Remarks

The asymmetric key is used to decrypt the symmetric key contained within the encrypted data. The symmetric key is used to decrypt the data.

The encryption method for the encrypted symmetric key is expected to be http://www.w3.org/2001/04/xmlenc#rsa-1_5 or http://www.w3.org/2001/04/xmlenc#rsa-oaep-mgf1p.

The encryption method for the data is specified in the encrypted data.

This method should be used if the assertion includes a signature to be verified.

The supported key encryption methods are:

  • http://www.w3.org/2001/04/xmlenc#rsa-1_5
  • http://www.w3.org/2001/04/xmlenc#rsa-oaep-mgf1p

The supported data encryption methods are:

  • http://www.w3.org/2001/04/xmlenc#tripledes-cbc
  • http://www.w3.org/2001/04/xmlenc#kw-tripledes
  • 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

Exceptions
Type Condition
SAMLEncryptionException

Thrown when the decryption fails.

See Also
EncryptedAssertion(SAMLAssertion, X509Certificate2, EncryptionMethod, EncryptionMethod)

DecryptToXml(AsymmetricAlgorithm, EncryptionMethod)

Decrypts an encrypted assertion to XML.

Declaration
public XmlElement DecryptToXml(AsymmetricAlgorithm keyDecryptingKey, EncryptionMethod dataEncryptionMethod)
Parameters
Type Name Description
System.Security.Cryptography.AsymmetricAlgorithm keyDecryptingKey

The asymmetric key decrypting key.

System.Security.Cryptography.Xml.EncryptionMethod dataEncryptionMethod

The method for decrypting the data or null if specified in the encrypted data.

Returns
Type Description
System.Xml.XmlElement

The SAML assertion XML.

Remarks

The asymmetric key is used to decrypt the symmetric key contained within the encrypted data. The symmetric key is used to decrypt the data.

The encryption method for the encrypted symmetric key is expected to be http://www.w3.org/2001/04/xmlenc#rsa-1_5 or http://www.w3.org/2001/04/xmlenc#rsa-oaep-mgf1p.

The encryption method for the data is specified in the encrypted data or may be explicitly specified.

This method should be used if the assertion includes a signature to be verified.

The supported key encryption methods are:

  • http://www.w3.org/2001/04/xmlenc#rsa-1_5
  • http://www.w3.org/2001/04/xmlenc#rsa-oaep-mgf1p

The supported data encryption methods are:

  • http://www.w3.org/2001/04/xmlenc#tripledes-cbc
  • http://www.w3.org/2001/04/xmlenc#kw-tripledes
  • 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

Exceptions
Type Condition
SAMLEncryptionException

Thrown when the decryption fails.

See Also
EncryptedAssertion(SAMLAssertion, X509Certificate2, EncryptionMethod, EncryptionMethod)

DecryptToXml(AsymmetricAlgorithm, EncryptionMethod, EncryptionMethod)

Decrypts an encrypted assertion to XML.

Declaration
public XmlElement DecryptToXml(AsymmetricAlgorithm keyDecryptingKey, EncryptionMethod keyEncryptionMethod, EncryptionMethod dataEncryptionMethod)
Parameters
Type Name Description
System.Security.Cryptography.AsymmetricAlgorithm keyDecryptingKey

The asymmetric key decrypting key.

System.Security.Cryptography.Xml.EncryptionMethod keyEncryptionMethod

The method for decrypting the symmetric key or null if specified in the encrypted key.

System.Security.Cryptography.Xml.EncryptionMethod dataEncryptionMethod

The method for decrypting the data or null if specified in the encrypted data.

Returns
Type Description
System.Xml.XmlElement

The SAML assertion XML.

Remarks

The asymmetric key is used to decrypt the symmetric key contained within the encrypted data. The symmetric key is used to decrypt the data.

The encryption method for the encrypted symmetric key is expected to be http://www.w3.org/2001/04/xmlenc#rsa-1_5 or http://www.w3.org/2001/04/xmlenc#rsa-oaep-mgf1p.

The encryption method for the key is specified in the encrypted data or may be explicitly specified.

The encryption method for the data is specified in the encrypted data or may be explicitly specified.

This method should be used if the assertion includes a signature to be verified.

The supported key encryption methods are:

  • http://www.w3.org/2001/04/xmlenc#rsa-1_5
  • http://www.w3.org/2001/04/xmlenc#rsa-oaep-mgf1p

The supported data encryption methods are:

  • http://www.w3.org/2001/04/xmlenc#tripledes-cbc
  • http://www.w3.org/2001/04/xmlenc#kw-tripledes
  • 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

Exceptions
Type Condition
SAMLEncryptionException

Thrown when the decryption fails.

See Also
EncryptedAssertion(SAMLAssertion, X509Certificate2, EncryptionMethod, EncryptionMethod)

DecryptToXml(X509Certificate2)

Decrypts an encrypted assertion to XML.

Declaration
public XmlElement DecryptToXml(X509Certificate2 x509Certificate)
Parameters
Type Name Description
System.Security.Cryptography.X509Certificates.X509Certificate2 x509Certificate

The X.509 certificate containing a private key.

Returns
Type Description
System.Xml.XmlElement

The SAML assertion XML.

Remarks

The X.509 certificate's private key is used to decrypt the symmetric key contained within the encrypted data. The symmetric key is used to decrypt the data.

The encryption method for the encrypted symmetric key is expected to be http://www.w3.org/2001/04/xmlenc#rsa-1_5 or http://www.w3.org/2001/04/xmlenc#rsa-oaep-mgf1p.

The encryption method for the data is specified in the encrypted data.

This method should be used if the assertion includes a signature to be verified.

The supported key encryption methods are:

  • http://www.w3.org/2001/04/xmlenc#rsa-1_5
  • http://www.w3.org/2001/04/xmlenc#rsa-oaep-mgf1p

The supported data encryption methods are:

  • http://www.w3.org/2001/04/xmlenc#tripledes-cbc
  • http://www.w3.org/2001/04/xmlenc#kw-tripledes
  • 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

Exceptions
Type Condition
SAMLEncryptionException

Thrown when the decryption fails.

See Also
EncryptedAssertion(SAMLAssertion, X509Certificate2, EncryptionMethod, EncryptionMethod)

DecryptToXml(X509Certificate2, EncryptionMethod)

Decrypts an encrypted assertion to XML.

Declaration
public XmlElement DecryptToXml(X509Certificate2 x509Certificate, EncryptionMethod dataEncryptionMethod)
Parameters
Type Name Description
System.Security.Cryptography.X509Certificates.X509Certificate2 x509Certificate

The X.509 certificate containing a private key.

System.Security.Cryptography.Xml.EncryptionMethod dataEncryptionMethod

The method for decrypting the data or null if specified in the encrypted data.

Returns
Type Description
System.Xml.XmlElement

The SAML assertion XML.

Remarks

The X.509 certificate's private key is used to decrypt the symmetric key contained within the encrypted data. The symmetric key is used to decrypt the data.

The encryption method for the encrypted symmetric key is expected to be http://www.w3.org/2001/04/xmlenc#rsa-1_5 or http://www.w3.org/2001/04/xmlenc#rsa-oaep-mgf1p.

The encryption method for the data is specified in the encrypted data or may be explicitly specified.

This method should be used if the assertion includes a signature to be verified.

The supported key encryption methods are:

  • http://www.w3.org/2001/04/xmlenc#rsa-1_5
  • http://www.w3.org/2001/04/xmlenc#rsa-oaep-mgf1p

The supported data encryption methods are:

  • http://www.w3.org/2001/04/xmlenc#tripledes-cbc
  • http://www.w3.org/2001/04/xmlenc#kw-tripledes
  • 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

Exceptions
Type Condition
SAMLEncryptionException

Thrown when the decryption fails.

See Also
EncryptedAssertion(SAMLAssertion, X509Certificate2, EncryptionMethod, EncryptionMethod)

DecryptToXml(X509Certificate2, EncryptionMethod, EncryptionMethod)

Decrypts an encrypted assertion to XML.

Declaration
public XmlElement DecryptToXml(X509Certificate2 x509Certificate, EncryptionMethod keyEncryptionMethod, EncryptionMethod dataEncryptionMethod)
Parameters
Type Name Description
System.Security.Cryptography.X509Certificates.X509Certificate2 x509Certificate

The X.509 certificate containing a private key.

System.Security.Cryptography.Xml.EncryptionMethod keyEncryptionMethod

The method for decrypting the symmetric key or null if specified in the encrypted key.

System.Security.Cryptography.Xml.EncryptionMethod dataEncryptionMethod

The method for decrypting the data or null if specified in the encrypted data.

Returns
Type Description
System.Xml.XmlElement

The SAML assertion XML.

Remarks

The X.509 certificate's private key is used to decrypt the symmetric key contained within the encrypted data. The symmetric key is used to decrypt the data.

The encryption method for the encrypted symmetric key is expected to be http://www.w3.org/2001/04/xmlenc#rsa-1_5 or http://www.w3.org/2001/04/xmlenc#rsa-oaep-mgf1p.

The encryption method for the key is specified in the encrypted data or may be explicitly specified.

The encryption method for the data is specified in the encrypted data or may be explicitly specified.

This method should be used if the assertion includes a signature to be verified.

The supported key encryption methods are:

  • http://www.w3.org/2001/04/xmlenc#rsa-1_5
  • http://www.w3.org/2001/04/xmlenc#rsa-oaep-mgf1p

The supported data encryption methods are:

  • http://www.w3.org/2001/04/xmlenc#tripledes-cbc
  • http://www.w3.org/2001/04/xmlenc#kw-tripledes
  • 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

Exceptions
Type Condition
SAMLEncryptionException

Thrown when the decryption fails.

See Also
EncryptedAssertion(SAMLAssertion, X509Certificate2, EncryptionMethod, EncryptionMethod)

IsValid(XmlElement)

Indicates whether the XML is an encrypted assertion.

Declaration
public static bool IsValid(XmlElement xmlElement)
Parameters
Type Name Description
System.Xml.XmlElement xmlElement

The XML to test.

Returns
Type Description
System.Boolean

true if the XML is an encrypted assertion; otherwise false.

ToXml()

Serializes the encrypted assertion to XML.

Declaration
public XmlElement ToXml()
Returns
Type Description
System.Xml.XmlElement

The encrypted assertion as XML.

Remarks

An XML document is created.

Exceptions
Type Condition
SAMLSerializationException

Thrown when the XML serialization fails.

ToXml(XmlDocument)

Serializes the encrypted assertion to XML.

Declaration
public XmlElement ToXml(XmlDocument xmlDocument)
Parameters
Type Name Description
System.Xml.XmlDocument xmlDocument

The owning XML document.

Returns
Type Description
System.Xml.XmlElement

The encrypted assertion as XML.

Exceptions
Type Condition
SAMLSerializationException

Thrown when the XML serialization fails.

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