C# Класс dk.nita.saml20.Saml20Assertion

Encapsulates the functionality required of a DK-SAML 2.0 Assertion.
Показать файл Открыть проект Примеры использования класса

Private Properties

Свойство Тип Описание
AddSignature void
CheckCertificateCanSign void
CheckSignature bool
ExtractAttributes void
InsertAttributes void
LoadXml void

Открытые методы

Метод Описание
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.

Приватные методы

Метод Описание
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.

Описание методов

CheckSignature() публичный Метод

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.
Результат bool

CheckValid() публичный Метод

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
Результат void

GetSignatureKeys() публичный Метод

Returns the KeyInfo element of the signature of the token.
public GetSignatureKeys ( ) : System.Security.Cryptography.Xml.KeyInfo
Результат System.Security.Cryptography.Xml.KeyInfo

GetXml() публичный Метод

Gets the assertion as an XmlDocument.
public GetXml ( ) : XmlElement
Результат System.Xml.XmlElement

IsExpired() публичный Метод

Checks if the expiration time has been exceeded.
public IsExpired ( ) : bool
Результат bool

Saml20Assertion() публичный Метод

Initializes a new instance of the Saml20Assertion class.
public Saml20Assertion ( ) : System
Результат System

Saml20Assertion() публичный Метод

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.
Результат System

Saml20Assertion() публичный Метод

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
Результат System

Saml20Assertion() публичный Метод

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.
Результат System

Sign() публичный Метод

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.
Результат void

WriteAssertion() публичный Метод

Writes the token to a writer.
public WriteAssertion ( XmlWriter writer ) : void
writer System.Xml.XmlWriter The writer.
Результат void