Table of Contents

Class Conditions

Namespace
ComponentSpace.Saml2.Assertions
Assembly
ComponentSpace.Saml2.dll

Represents conditions.

public class Conditions
Inheritance
Conditions
Inherited Members

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.

public Conditions()

Conditions(TimeSpan)

Initializes a new instance of the Conditions class.

public Conditions(TimeSpan timeSpan)

Parameters

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.

public Conditions(XmlElement xmlElement)

Parameters

xmlElement XmlElement

The conditions XML.

Exceptions

SamlSerializationException

Thrown when the XML deserialization fails.

Properties

ConditionList

Gets or sets the list of conditions.

public IList<ICondition> ConditionList { get; set; }

Property Value

IList<ICondition>

The list of conditions.

See Also

NotBefore

Gets or sets the not before time.

public DateTime? NotBefore { get; set; }

Property Value

DateTime?

The not before time as coordinated universal time (UTC).

NotOnOrAfter

Gets or sets the not on or after time.

public DateTime? NotOnOrAfter { get; set; }

Property Value

DateTime?

The not on or after time as coordinated universal time (UTC).

Methods

GetAudienceRestrictions()

Returns all audience restriction conditions.

public IList<AudienceRestriction> GetAudienceRestrictions()

Returns

IList<AudienceRestriction>

The list of audience restriction conditions.

GetOneTimeUses()

Returns all one time use conditions.

public IList<OneTimeUse> GetOneTimeUses()

Returns

IList<OneTimeUse>

The list of one time use conditions.

GetProxyRestrictions()

Returns all audience restriction conditions.

public IList<ProxyRestriction> GetProxyRestrictions()

Returns

IList<ProxyRestriction>

The list of audience restriction conditions.

IsValid(XmlElement)

Indicates whether the XML is conditions.

public static bool IsValid(XmlElement xmlElement)

Parameters

xmlElement XmlElement

The XML to test.

Returns

bool

true if the XML is conditions; otherwise false.

IsWithinTimePeriod()

Indicates whether the current UTC time is within the not before and not on or after period, if specified.

public bool IsWithinTimePeriod()

Returns

bool

true if within the time period; otherwise false.

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.

public bool IsWithinTimePeriod(TimeSpan clockSkew)

Parameters

clockSkew TimeSpan

The time span to allow for clock skew.

Returns

bool

true if within the time period; otherwise false.

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.

public XmlElement ToXml(XmlDocument xmlDocument)

Parameters

xmlDocument XmlDocument

The owning XML document.

Returns

XmlElement

The conditions as XML.

Exceptions

SamlSerializationException

Thrown when the XML serialization fails.