//-----------------------------------------------------------------------
//
// Copyright (c) Microsoft Corporation. All rights reserved.
//
//-----------------------------------------------------------------------
namespace System.IdentityModel.Tokens
{
using System;
///
/// Represents the SubjectConfirmation element specified in [Saml2Core, 2.4.1.1].
///
public class Saml2SubjectConfirmation
{
private Saml2SubjectConfirmationData data;
private Uri method;
private Saml2NameIdentifier nameId;
///
/// Initializes an instance of from a indicating the
/// method of confirmation.
///
/// The to use for initialization.
public Saml2SubjectConfirmation(Uri method)
: this(method, null)
{
}
///
/// Initializes an instance of from a indicating the
/// method of confirmation and .
///
/// The to use for initialization.
/// The to use for initialization.
public Saml2SubjectConfirmation(Uri method, Saml2SubjectConfirmationData data)
{
if (null == method)
{
throw DiagnosticUtility.ExceptionUtility.ThrowHelperArgumentNull("method");
}
if (!method.IsAbsoluteUri)
{
throw DiagnosticUtility.ExceptionUtility.ThrowHelperArgument("method", SR.GetString(SR.ID0013));
}
this.method = method;
this.data = data;
}
///
/// Gets or sets a URI reference that identifies a protocol or mechanism to be used to
/// confirm the subject. [Saml2Core, 2.4.1.1]
///
public Uri Method
{
get
{
return this.method;
}
set
{
if (null == value)
{
throw DiagnosticUtility.ExceptionUtility.ThrowHelperArgumentNull("value");
}
if (!value.IsAbsoluteUri)
{
throw DiagnosticUtility.ExceptionUtility.ThrowHelperArgument("value", SR.GetString(SR.ID0013));
}
this.method = value;
}
}
///
/// Gets or sets the expected to satisfy the enclosing subject
/// confirmation requirements. [Saml2Core, 2.4.1.1]
///
public Saml2NameIdentifier NameIdentifier
{
get { return this.nameId; }
set { this.nameId = value; }
}
///
/// Gets or sets additional to be used by a specific confirmation
/// method. [Saml2Core, 2.4.1.1]
///
public Saml2SubjectConfirmationData SubjectConfirmationData
{
get { return this.data; }
set { this.data = value; }
}
}
}