Class EncryptedAssertion
Represents an encrypted assertion.
Inherited Members
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.  | 
      
| AsymmetricAlgorithm | keyEncryptingKey | The asymmetric key encrypting key.  | 
      
| EncryptionMethod | keyEncryptionMethod | The method for encrypting the symmetric key.  | 
      
| EncryptionMethod | dataEncryptionMethod | The method for encrypting the data.  | 
      
| 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.  | 
      
| AsymmetricAlgorithm | keyEncryptingKey | The asymmetric key encrypting key.  | 
      
| EncryptionMethod | keyEncryptionMethod | The method for encrypting the symmetric key.  | 
      
| EncryptionMethod | dataEncryptionMethod | The method for encrypting the data.  | 
      
| string | digestMethod | The key encryption digest method or   | 
      
| string | maskGenerationFunction | The key encryption mask generation function or   | 
      
| 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.  | 
      
| AsymmetricAlgorithm | keyEncryptingKey | The asymmetric key encrypting key.  | 
      
| EncryptionMethod | dataEncryptionMethod | The method for encrypting the data.  | 
      
| 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.  | 
      
| AsymmetricAlgorithm | keyEncryptingKey | The asymmetric key encrypting key.  | 
      
| 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.  | 
      
| 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
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.  | 
      
| X509Certificate2 | x509Certificate | The X.509 certificate used when encrypting the data.  | 
      
| 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
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.  | 
      
| X509Certificate2 | x509Certificate | The X.509 certificate used when encrypting the data.  | 
      
| EncryptionMethod | keyEncryptionMethod | The method for encrypting the symmetric key.  | 
      
| 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
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.  | 
      
| X509Certificate2 | x509Certificate | The X.509 certificate used when encrypting the data.  | 
      
| EncryptionMethod | keyEncryptionMethod | The method for encrypting the symmetric key.  | 
      
| EncryptionMethod | dataEncryptionMethod | The method for encrypting the data.  | 
      
| string | digestMethod | The key encryption digest method or   | 
      
| string | maskGenerationFunction | The key encryption mask generation function or   | 
      
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
EncryptedAssertion(XmlElement)
Initializes a new instance of the EncryptedAssertion class from XML.
Declaration
public EncryptedAssertion(XmlElement xmlElement)
  Parameters
| Type | Name | Description | 
|---|---|---|
| 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 | 
|---|---|---|
| XmlElement | samlAssertion | The SAML assertion XML.  | 
      
| AsymmetricAlgorithm | keyEncryptingKey | The asymmetric key encrypting key.  | 
      
| EncryptionMethod | keyEncryptionMethod | The method for encrypting the symmetric key.  | 
      
| EncryptionMethod | dataEncryptionMethod | The method for encrypting the data.  | 
      
| 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 | 
|---|---|---|
| XmlElement | samlAssertion | The SAML assertion XML.  | 
      
| AsymmetricAlgorithm | keyEncryptingKey | The asymmetric key encrypting key.  | 
      
| EncryptionMethod | keyEncryptionMethod | The method for encrypting the symmetric key.  | 
      
| EncryptionMethod | dataEncryptionMethod | The method for encrypting the data.  | 
      
| string | digestMethod | The key encryption digest method or   | 
      
| string | maskGenerationFunction | The key encryption mask generation function or   | 
      
| 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 | 
|---|---|---|
| XmlElement | samlAssertion | The SAML assertion XML.  | 
      
| AsymmetricAlgorithm | keyEncryptingKey | The asymmetric key encrypting key.  | 
      
| EncryptionMethod | dataEncryptionMethod | The method for encrypting the data.  | 
      
| 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 | 
|---|---|---|
| XmlElement | samlAssertion | The SAML assertion XML.  | 
      
| AsymmetricAlgorithm | keyEncryptingKey | The asymmetric key encrypting key.  | 
      
| 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 | 
|---|---|---|
| XmlElement | samlAssertion | The SAML assertion XML.  | 
      
| 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
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 | 
|---|---|---|
| XmlElement | samlAssertion | The SAML assertion XML.  | 
      
| X509Certificate2 | x509Certificate | The X.509 certificate used when encrypting the data.  | 
      
| 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
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 | 
|---|---|---|
| XmlElement | samlAssertion | The SAML assertion XML.  | 
      
| X509Certificate2 | x509Certificate | The X.509 certificate used when encrypting the data.  | 
      
| EncryptionMethod | keyEncryptionMethod | The method for encrypting the symmetric key.  | 
      
| 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
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 | 
|---|---|---|
| XmlElement | samlAssertion | The SAML assertion XML.  | 
      
| X509Certificate2 | x509Certificate | The X.509 certificate used when encrypting the data.  | 
      
| EncryptionMethod | keyEncryptionMethod | The method for encrypting the symmetric key.  | 
      
| EncryptionMethod | dataEncryptionMethod | The method for encrypting the data.  | 
      
| string | digestMethod | The key encryption digest method or   | 
      
| string | maskGenerationFunction | The key encryption mask generation function or   | 
      
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
EncryptedAssertion(XmlElement, XmlNodeList)
Initializes a new instance of the EncryptedAssertion class.
Declaration
public EncryptedAssertion(XmlElement encryptedData, XmlNodeList encryptedKeys)
  Parameters
| Type | Name | Description | 
|---|---|---|
| XmlElement | encryptedData | The encrypted data.  | 
      
| XmlNodeList | encryptedKeys | The encrypted keys.  | 
      
Methods
Decrypt(AsymmetricAlgorithm)
Decrypts an encrypted assertion.
Declaration
public SAMLAssertion Decrypt(AsymmetricAlgorithm keyDecryptingKey)
  Parameters
| Type | Name | Description | 
|---|---|---|
| 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
Decrypt(AsymmetricAlgorithm, EncryptionMethod)
Decrypts an encrypted assertion.
Declaration
public SAMLAssertion Decrypt(AsymmetricAlgorithm keyDecryptingKey, EncryptionMethod dataEncryptionMethod)
  Parameters
| Type | Name | Description | 
|---|---|---|
| AsymmetricAlgorithm | keyDecryptingKey | The asymmetric key decrypting key.  | 
      
| EncryptionMethod | dataEncryptionMethod | The method for decrypting the data or   | 
      
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
Decrypt(AsymmetricAlgorithm, EncryptionMethod, EncryptionMethod)
Decrypts an encrypted assertion.
Declaration
public SAMLAssertion Decrypt(AsymmetricAlgorithm keyDecryptingKey, EncryptionMethod keyEncryptionMethod, EncryptionMethod dataEncryptionMethod)
  Parameters
| Type | Name | Description | 
|---|---|---|
| AsymmetricAlgorithm | keyDecryptingKey | The asymmetric key decrypting key.  | 
      
| EncryptionMethod | keyEncryptionMethod | The method for decrypting the symmetric key or   | 
      
| EncryptionMethod | dataEncryptionMethod | The method for decrypting the data or   | 
      
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
Decrypt(X509Certificate2)
Decrypts an encrypted assertion.
Declaration
public SAMLAssertion Decrypt(X509Certificate2 x509Certificate)
  Parameters
| Type | Name | Description | 
|---|---|---|
| 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
Decrypt(X509Certificate2, EncryptionMethod)
Decrypts an encrypted assertion.
Declaration
public SAMLAssertion Decrypt(X509Certificate2 x509Certificate, EncryptionMethod dataEncryptionMethod)
  Parameters
| Type | Name | Description | 
|---|---|---|
| X509Certificate2 | x509Certificate | The X.509 certificate containing a private key.  | 
      
| EncryptionMethod | dataEncryptionMethod | The method for decrypting the data or   | 
      
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
Decrypt(X509Certificate2, EncryptionMethod, EncryptionMethod)
Decrypts an encrypted assertion.
Declaration
public SAMLAssertion Decrypt(X509Certificate2 x509Certificate, EncryptionMethod keyEncryptionMethod, EncryptionMethod dataEncryptionMethod)
  Parameters
| Type | Name | Description | 
|---|---|---|
| X509Certificate2 | x509Certificate | The X.509 certificate containing a private key.  | 
      
| EncryptionMethod | keyEncryptionMethod | The method for decrypting the symmetric key or   | 
      
| EncryptionMethod | dataEncryptionMethod | The method for decrypting the data or   | 
      
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
DecryptToXml(AsymmetricAlgorithm)
Decrypts an encrypted assertion to XML.
Declaration
public XmlElement DecryptToXml(AsymmetricAlgorithm keyDecryptingKey)
  Parameters
| Type | Name | Description | 
|---|---|---|
| AsymmetricAlgorithm | keyDecryptingKey | The asymmetric key decrypting key.  | 
      
Returns
| Type | Description | 
|---|---|
| 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
DecryptToXml(AsymmetricAlgorithm, EncryptionMethod)
Decrypts an encrypted assertion to XML.
Declaration
public XmlElement DecryptToXml(AsymmetricAlgorithm keyDecryptingKey, EncryptionMethod dataEncryptionMethod)
  Parameters
| Type | Name | Description | 
|---|---|---|
| AsymmetricAlgorithm | keyDecryptingKey | The asymmetric key decrypting key.  | 
      
| EncryptionMethod | dataEncryptionMethod | The method for decrypting the data or   | 
      
Returns
| Type | Description | 
|---|---|
| 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
DecryptToXml(AsymmetricAlgorithm, EncryptionMethod, EncryptionMethod)
Decrypts an encrypted assertion to XML.
Declaration
public XmlElement DecryptToXml(AsymmetricAlgorithm keyDecryptingKey, EncryptionMethod keyEncryptionMethod, EncryptionMethod dataEncryptionMethod)
  Parameters
| Type | Name | Description | 
|---|---|---|
| AsymmetricAlgorithm | keyDecryptingKey | The asymmetric key decrypting key.  | 
      
| EncryptionMethod | keyEncryptionMethod | The method for decrypting the symmetric key or   | 
      
| EncryptionMethod | dataEncryptionMethod | The method for decrypting the data or   | 
      
Returns
| Type | Description | 
|---|---|
| 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
DecryptToXml(X509Certificate2)
Decrypts an encrypted assertion to XML.
Declaration
public XmlElement DecryptToXml(X509Certificate2 x509Certificate)
  Parameters
| Type | Name | Description | 
|---|---|---|
| X509Certificate2 | x509Certificate | The X.509 certificate containing a private key.  | 
      
Returns
| Type | Description | 
|---|---|
| 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
DecryptToXml(X509Certificate2, EncryptionMethod)
Decrypts an encrypted assertion to XML.
Declaration
public XmlElement DecryptToXml(X509Certificate2 x509Certificate, EncryptionMethod dataEncryptionMethod)
  Parameters
| Type | Name | Description | 
|---|---|---|
| X509Certificate2 | x509Certificate | The X.509 certificate containing a private key.  | 
      
| EncryptionMethod | dataEncryptionMethod | The method for decrypting the data or   | 
      
Returns
| Type | Description | 
|---|---|
| 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
DecryptToXml(X509Certificate2, EncryptionMethod, EncryptionMethod)
Decrypts an encrypted assertion to XML.
Declaration
public XmlElement DecryptToXml(X509Certificate2 x509Certificate, EncryptionMethod keyEncryptionMethod, EncryptionMethod dataEncryptionMethod)
  Parameters
| Type | Name | Description | 
|---|---|---|
| X509Certificate2 | x509Certificate | The X.509 certificate containing a private key.  | 
      
| EncryptionMethod | keyEncryptionMethod | The method for decrypting the symmetric key or   | 
      
| EncryptionMethod | dataEncryptionMethod | The method for decrypting the data or   | 
      
Returns
| Type | Description | 
|---|---|
| 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
IsValid(XmlElement)
Indicates whether the XML is an encrypted assertion.
Declaration
public static bool IsValid(XmlElement xmlElement)
  Parameters
| Type | Name | Description | 
|---|---|---|
| XmlElement | xmlElement | The XML to test.  | 
      
Returns
| Type | Description | 
|---|---|
| bool | 
  | 
      
ToXml()
Serializes the encrypted assertion to XML.
Declaration
public XmlElement ToXml()
  Returns
| Type | Description | 
|---|---|
| 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 | 
|---|---|---|
| XmlDocument | xmlDocument | The owning XML document.  | 
      
Returns
| Type | Description | 
|---|---|
| XmlElement | The encrypted assertion as XML.  | 
      
Exceptions
| Type | Condition | 
|---|---|
| SAMLSerializationException | Thrown when the XML serialization fails.  |