//-----------------------------------------------------------------------
//
// Copyright (c) Microsoft Corporation. All rights reserved.
//
//-----------------------------------------------------------------------
namespace System.IdentityModel.Tokens
{
using System;
using System.Collections.Generic;
///
/// This class wraps a Saml2AssertionKeyIdentifierClause and delegates to the wrapped clause.
/// It derives off the SamlAssertionKeyIdentifierClause to get around a specific bug in WCF
/// where the WCF runtime will call the Saml2SecurityToken to create a SamlAssertionKeyIdentifierClause.
///
internal class WrappedSaml2AssertionKeyIdentifierClause : SamlAssertionKeyIdentifierClause
{
private Saml2AssertionKeyIdentifierClause clause;
///
/// Creates an instance of
///
/// A to be wrapped.
public WrappedSaml2AssertionKeyIdentifierClause(Saml2AssertionKeyIdentifierClause clause)
: base(clause.Id)
{
this.clause = clause;
}
///
/// Gets a boolean that states if the clause can create a Key.
/// This returns false by default.
///
public override bool CanCreateKey
{
get
{
return this.clause.CanCreateKey;
}
}
///
/// Gets the wrapped .
///
public Saml2AssertionKeyIdentifierClause WrappedClause
{
get { return this.clause; }
}
///
/// Creates a key from this clause type.
///
/// A
public override SecurityKey CreateKey()
{
return this.clause.CreateKey();
}
///
/// Returns a value that indicates whether the key identifier for this instance
/// is equivalent to the specified key identifier clause.
///
/// A to compare to.
/// 'True' if keyIdentifierClause matches this. 'False' otherwise.
public override bool Matches(SecurityKeyIdentifierClause keyIdentifierClause)
{
return this.clause.Matches(keyIdentifierClause);
}
}
}