Class Conditions
Represents conditions.
Inheritance
Inherited Members
Namespace: ComponentSpace.Saml2.Assertions
Assembly: ComponentSpace.Saml2.dll
Syntax
public class Conditions
Remarks
Refer to the Assertions and Protocol for the OASIS Security Assertion Markup Language (SAML) V2.0 specification for further details.
Constructors
Conditions()
Initializes a new instance of the Conditions
class.
Declaration
public Conditions()
Conditions(TimeSpan)
Initializes a new instance of the Conditions
class.
Declaration
public Conditions(TimeSpan timeSpan)
Parameters
Type | Name | Description |
---|---|---|
System.TimeSpan | timeSpan | The timespan before and after now. |
Remarks
The not before time is calculated as the current UTC time less the time span. The not on or after time is calculated as the current UTC time plus the time span.
Conditions(XmlElement)
Initializes a new instance of the Conditions
class from XML.
Declaration
public Conditions(XmlElement xmlElement)
Parameters
Type | Name | Description |
---|---|---|
System.Xml.XmlElement | xmlElement | The conditions XML. |
Exceptions
Type | Condition |
---|---|
SamlSerializationException | Thrown when the XML deserialization fails. |
Properties
ConditionList
Gets or sets the list of conditions.
Declaration
public IList<ICondition> ConditionList { get; set; }
Property Value
Type | Description |
---|---|
System.Collections.Generic.IList<ICondition> | The list of conditions. |
See Also
NotBefore
Gets or sets the not before time.
Declaration
public DateTime? NotBefore { get; set; }
Property Value
Type | Description |
---|---|
System.Nullable<System.DateTime> | The not before time as coordinated universal time (UTC). |
NotOnOrAfter
Gets or sets the not on or after time.
Declaration
public DateTime? NotOnOrAfter { get; set; }
Property Value
Type | Description |
---|---|
System.Nullable<System.DateTime> | The not on or after time as coordinated universal time (UTC). |
Methods
GetAudienceRestrictions()
Returns all audience restriction conditions.
Declaration
public IList<AudienceRestriction> GetAudienceRestrictions()
Returns
Type | Description |
---|---|
System.Collections.Generic.IList<AudienceRestriction> | The list of audience restriction conditions. |
GetOneTimeUses()
Returns all one time use conditions.
Declaration
public IList<OneTimeUse> GetOneTimeUses()
Returns
Type | Description |
---|---|
System.Collections.Generic.IList<OneTimeUse> | The list of one time use conditions. |
GetProxyRestrictions()
Returns all audience restriction conditions.
Declaration
public IList<ProxyRestriction> GetProxyRestrictions()
Returns
Type | Description |
---|---|
System.Collections.Generic.IList<ProxyRestriction> | The list of audience restriction conditions. |
IsValid(XmlElement)
Indicates whether the XML is conditions.
Declaration
public static bool IsValid(XmlElement xmlElement)
Parameters
Type | Name | Description |
---|---|---|
System.Xml.XmlElement | xmlElement | The XML to test. |
Returns
Type | Description |
---|---|
System.Boolean |
|
IsWithinTimePeriod()
Indicates whether the current UTC time is within the not before and not on or after period, if specified.
Declaration
public bool IsWithinTimePeriod()
Returns
Type | Description |
---|---|
System.Boolean |
|
Remarks
To be within the time period, not before < UTC now <= not on or after
IsWithinTimePeriod(TimeSpan)
Indicates whether the current UTC time is within the not before and not on or after period, if specified. The supplied time span is to allow for clock skew.
Declaration
public bool IsWithinTimePeriod(TimeSpan clockSkew)
Parameters
Type | Name | Description |
---|---|---|
System.TimeSpan | clockSkew | The time span to allow for clock skew. |
Returns
Type | Description |
---|---|
System.Boolean |
|
Remarks
To be within the time period, not before - clock skew < UTC now <= not on or after + clock skew
ToXml(XmlDocument)
Serializes the conditions 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 conditions as XML. |
Exceptions
Type | Condition |
---|---|
SamlSerializationException | Thrown when the XML serialization fails. |