C# Class dk.nita.saml20.Saml20Assertion

Encapsulates the functionality required of a DK-SAML 2.0 Assertion.
Afficher le fichier Open project: symplified/Symplified.Auth Class Usage Examples

Private Properties

Свойство Type Description
AddSignature void
CheckCertificateCanSign void
CheckSignature bool
ExtractAttributes void
InsertAttributes void
LoadXml void

Méthodes publiques

Méthode Description
CheckSignature ( IEnumerable keys ) : bool

Check the signature of the XmlDocument using the list of keys. If the signature key is found, the SigningKey property is set.

CheckValid ( IEnumerable trustedSigners ) : void

Verifies the assertion's signature and its time to live.

GetSignatureKeys ( ) : System.Security.Cryptography.Xml.KeyInfo

Returns the KeyInfo element of the signature of the token.

GetXml ( ) : XmlElement

Gets the assertion as an XmlDocument.

IsExpired ( ) : bool

Checks if the expiration time has been exceeded.

Saml20Assertion ( ) : System

Initializes a new instance of the Saml20Assertion class.

Saml20Assertion ( XmlElement assertion, IEnumerable trustedSigners, AssertionProfile profile, bool quirksMode ) : System

Initializes a new instance of the Saml20Assertion class.

Saml20Assertion ( XmlElement assertion, IEnumerable trustedSigners, AssertionProfile profile, bool quirksMode, bool autoValidate ) : System

Initializes a new instance of the Saml20Assertion class.

Saml20Assertion ( XmlElement assertion, IEnumerable trustedSigners, bool quirksMode ) : System

Initializes a new instance of the Saml20Assertion class.

Sign ( X509Certificate2 cert ) : void

Signs the assertion with the given certificate.

WriteAssertion ( XmlWriter writer ) : void

Writes the token to a writer.

Private Methods

Méthode Description
AddSignature ( XmlDocument assertionDocument, X509Certificate2 cert ) : void
CheckCertificateCanSign ( X509Certificate2 cert ) : void
CheckSignature ( AsymmetricAlgorithm key ) : bool
ExtractAttributes ( ) : void

Extracts the list of attributes from the <AttributeStatement> of the assertion, and stores it in _assertionAttributes.

InsertAttributes ( ) : void

Merges the modified attributes into AttributeStatement of the assertion.

LoadXml ( XmlElement element, IEnumerable trustedSigners ) : void

Loads an assertion from XML.

Method Details

CheckSignature() public méthode

Check the signature of the XmlDocument using the list of keys. If the signature key is found, the SigningKey property is set.
public CheckSignature ( IEnumerable keys ) : bool
keys IEnumerable A list of KeyDescriptor elements. Probably extracted from the metadata describing the IDP that sent the message.
Résultat bool

CheckValid() public méthode

Verifies the assertion's signature and its time to live.
if the assertion's signature can not be verified or its time to live has been exceeded.
public CheckValid ( IEnumerable trustedSigners ) : void
trustedSigners IEnumerable
Résultat void

GetSignatureKeys() public méthode

Returns the KeyInfo element of the signature of the token.
public GetSignatureKeys ( ) : System.Security.Cryptography.Xml.KeyInfo
Résultat System.Security.Cryptography.Xml.KeyInfo

GetXml() public méthode

Gets the assertion as an XmlDocument.
public GetXml ( ) : XmlElement
Résultat System.Xml.XmlElement

IsExpired() public méthode

Checks if the expiration time has been exceeded.
public IsExpired ( ) : bool
Résultat bool

Saml20Assertion() public méthode

Initializes a new instance of the Saml20Assertion class.
public Saml20Assertion ( ) : System
Résultat System

Saml20Assertion() public méthode

Initializes a new instance of the Saml20Assertion class.
public Saml20Assertion ( XmlElement assertion, IEnumerable trustedSigners, AssertionProfile profile, bool quirksMode ) : System
assertion System.Xml.XmlElement The assertion.
trustedSigners IEnumerable If null, the signature of the given assertion is not verified.
profile AssertionProfile Determines the type of validation to perform on the token
quirksMode bool if set to true quirks mode is enabled.
Résultat System

Saml20Assertion() public méthode

Initializes a new instance of the Saml20Assertion class.
public Saml20Assertion ( XmlElement assertion, IEnumerable trustedSigners, AssertionProfile profile, bool quirksMode, bool autoValidate ) : System
assertion System.Xml.XmlElement The assertion.
trustedSigners IEnumerable If null, the signature of the given assertion is not verified.
profile AssertionProfile Determines the type of validation to perform on the token
quirksMode bool if set to true quirks mode is enabled.
autoValidate bool Turn automatic validation on or off
Résultat System

Saml20Assertion() public méthode

Initializes a new instance of the Saml20Assertion class.
public Saml20Assertion ( XmlElement assertion, IEnumerable trustedSigners, bool quirksMode ) : System
assertion System.Xml.XmlElement The assertion.
trustedSigners IEnumerable If null, the signature of the given assertion is not verified.
quirksMode bool if set to true quirks mode is enabled.
Résultat System

Sign() public méthode

Signs the assertion with the given certificate.
public Sign ( X509Certificate2 cert ) : void
cert System.Security.Cryptography.X509Certificates.X509Certificate2 The certificate to sign the assertion with.
Résultat void

WriteAssertion() public méthode

Writes the token to a writer.
public WriteAssertion ( XmlWriter writer ) : void
writer System.Xml.XmlWriter The writer.
Résultat void