Class SubjectConfirmationData
Represents subject confirmation data.
Inherited Members
Namespace: ComponentSpace.SAML2.Assertions
Assembly: ComponentSpace.Saml2.dll
Syntax
public class SubjectConfirmationData
  Remarks
Refer to the Assertions and Protocol for the OASIS Security Assertion Markup Language (SAML) V2.0 specification for further details.
Constructors
SubjectConfirmationData()
Initializes a new instance of the SubjectConfirmationData class.
Declaration
public SubjectConfirmationData()
  SubjectConfirmationData(DateTime, DateTime)
Initializes a new instance of the SubjectConfirmationData class.
Declaration
public SubjectConfirmationData(DateTime notBefore, DateTime notOnOrAfter)
  Parameters
| Type | Name | Description | 
|---|---|---|
| DateTime | notBefore | The not before time as coordinated universal time (UTC).  | 
      
| DateTime | notOnOrAfter | The not on or after time as coordinated universal time (UTC).  | 
      
SubjectConfirmationData(TimeSpan)
Initializes a new instance of the SubjectConfirmationData class.
Declaration
public SubjectConfirmationData(TimeSpan timeSpan)
  Parameters
| Type | Name | Description | 
|---|---|---|
| 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.
SubjectConfirmationData(XmlElement)
Initializes a new instance of the SubjectConfirmationData class from XML.
Declaration
public SubjectConfirmationData(XmlElement xmlElement)
  Parameters
| Type | Name | Description | 
|---|---|---|
| XmlElement | xmlElement | The subject confirmation data XML.  | 
      
Exceptions
| Type | Condition | 
|---|---|
| SAMLSerializationException | Thrown when the XML deserialization fails.  | 
      
Properties
Address
Gets or sets the address.
Declaration
public string Address { get; set; }
  Property Value
| Type | Description | 
|---|---|
| string | The address.  | 
      
Attributes
Gets or sets the XML attributes.
Declaration
public XmlAttributeCollection Attributes { get; set; }
  Property Value
| Type | Description | 
|---|---|
| XmlAttributeCollection | The XML attributes.  | 
      
Data
Gets or sets the data.
Declaration
public XmlNodeList Data { get; set; }
  Property Value
| Type | Description | 
|---|---|
| XmlNodeList | The data.  | 
      
InResponseTo
Gets or sets the in response to value.
Declaration
public string InResponseTo { get; set; }
  Property Value
| Type | Description | 
|---|---|
| string | The in response to value.  | 
      
NotBefore
Gets or sets the not before time.
Declaration
public DateTime NotBefore { get; set; }
  Property Value
| Type | Description | 
|---|---|
| DateTime | The not before time as coordinated universal time (UTC). A value of DateTime.MinValue indicates the value has not been set.  | 
      
NotOnOrAfter
Gets or sets the not on or after time.
Declaration
public DateTime NotOnOrAfter { get; set; }
  Property Value
| Type | Description | 
|---|---|
| DateTime | The not on or after time as coordinated universal time (UTC). A value of DateTime.MaxValue indicates the value has not been set.  | 
      
Recipient
Gets or sets the recipient.
Declaration
public string Recipient { get; set; }
  Property Value
| Type | Description | 
|---|---|
| string | The recipient.  | 
      
Methods
IsValid(XmlElement)
Indicates whether the XML is subject confirmation data.
Declaration
public static bool IsValid(XmlElement xmlElement)
  Parameters
| Type | Name | Description | 
|---|---|---|
| XmlElement | xmlElement | The XML to test.  | 
      
Returns
| Type | Description | 
|---|---|
| bool | 
  | 
      
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 | 
|---|---|
| bool | 
  | 
      
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 | 
|---|---|---|
| TimeSpan | clockSkew | The time span to allow for clock skew.  | 
      
Returns
| Type | Description | 
|---|---|
| bool | 
  | 
      
Remarks
To be within the time period, not before - clock skew > UTC now >= not on or after + clock skew
ToXml(XmlDocument)
Serializes the subject confirmation data to XML.
Declaration
public XmlElement ToXml(XmlDocument xmlDocument)
  Parameters
| Type | Name | Description | 
|---|---|---|
| XmlDocument | xmlDocument | The owning XML document.  | 
      
Returns
| Type | Description | 
|---|---|
| XmlElement | The subject confirmation data as XML.  | 
      
Exceptions
| Type | Condition | 
|---|---|
| SAMLSerializationException | Thrown when the XML serialization fails.  |