1 //-----------------------------------------------------------------------------
2 // Copyright (c) Microsoft Corporation. All rights reserved.
3 //-----------------------------------------------------------------------------
5 namespace System.IdentityModel.Tokens
7 using System.Globalization;
9 public class SamlAssertionKeyIdentifierClause : SecurityKeyIdentifierClause
11 readonly string assertionId;
12 readonly string valueType;
13 readonly string tokenTypeUri;
14 readonly string binding;
15 readonly string location;
16 readonly string authorityKind;
18 public SamlAssertionKeyIdentifierClause(string assertionId)
19 : this(assertionId, null, 0)
23 public SamlAssertionKeyIdentifierClause(string assertionId, byte[] derivationNonce, int derivationLength)
24 : this(assertionId, derivationNonce, derivationLength, null, null, null, null, null)
28 internal SamlAssertionKeyIdentifierClause(string assertionId, byte[] derivationNonce, int derivationLength, string valueType, string tokenTypeUri, string binding, string location, string authorityKind)
29 : base(null, derivationNonce, derivationLength)
31 if (assertionId == null)
33 throw DiagnosticUtility.ExceptionUtility.ThrowHelperArgumentNull("assertionId");
35 this.assertionId = assertionId;
36 this.valueType = valueType;
37 this.tokenTypeUri = tokenTypeUri;
38 this.binding = binding;
39 this.location = location;
40 this.authorityKind = authorityKind;
43 public string AssertionId
45 get { return this.assertionId; }
48 internal string TokenTypeUri
50 get { return this.tokenTypeUri; }
53 internal string ValueType
55 get { return this.valueType; }
58 internal string Binding
60 get { return this.binding; }
63 internal string Location
65 get { return this.location; }
68 internal string AuthorityKind
70 get { return this.authorityKind; }
73 public override bool Matches(SecurityKeyIdentifierClause keyIdentifierClause)
75 SamlAssertionKeyIdentifierClause that = keyIdentifierClause as SamlAssertionKeyIdentifierClause;
78 #pragma warning suppress 56506
79 return ReferenceEquals(this, that) || (that != null && that.Matches(this.assertionId));
82 public bool Matches(string assertionId)
84 return this.assertionId == assertionId;
87 public override string ToString()
89 return string.Format(CultureInfo.InvariantCulture, "SamlAssertionKeyIdentifierClause(AssertionId = '{0}')", this.AssertionId);