Beispiel #1
0
        public virtual bool MatchesKeyIdentifierClause(SecurityKeyIdentifierClause keyIdentifierClause)
        {
            LocalIdKeyIdentifierClause localKeyIdentifierClause = keyIdentifierClause as LocalIdKeyIdentifierClause;

            if (localKeyIdentifierClause != null)
            {
                return(localKeyIdentifierClause.Matches(this.Id, this.GetType()));
            }

            return(false);
        }
Beispiel #2
0
            public override void WriteContent(XmlDictionaryWriter writer, SecurityKeyIdentifierClause clause)
            {
                LocalIdKeyIdentifierClause localIdClause = clause as LocalIdKeyIdentifierClause;

                writer.WriteStartElement(CoreWCF.XD.SecurityJan2004Dictionary.Prefix.Value, CoreWCF.XD.SecurityJan2004Dictionary.Reference, CoreWCF.XD.SecurityJan2004Dictionary.Namespace);
                if (_emitBspRequiredAttributes)
                {
                    string tokenTypeUri = GetLocalTokenTypeUri(localIdClause);
                    if (tokenTypeUri != null)
                    {
                        writer.WriteAttributeString(CoreWCF.XD.SecurityJan2004Dictionary.ValueType, null, tokenTypeUri);
                    }
                }
                writer.WriteAttributeString(CoreWCF.XD.SecurityJan2004Dictionary.URI, null, "#" + localIdClause.LocalId);
                writer.WriteEndElement();
            }
Beispiel #3
0
            public override SecurityKeyIdentifierClause ReadClause(XmlDictionaryReader reader, byte[] derivationNonce, int derivationLength, string tokenType)
            {
                string uri          = reader.GetAttribute(CoreWCF.XD.SecurityJan2004Dictionary.URI, null);
                string tokenTypeUri = reader.GetAttribute(CoreWCF.XD.SecurityJan2004Dictionary.ValueType, null);

                Type[] tokenTypes = null;
                if (tokenTypeUri != null)
                {
                    tokenTypes = _tokenSerializer.GetTokenTypes(tokenTypeUri);
                }
                SecurityKeyIdentifierClause clause = new LocalIdKeyIdentifierClause(uri.Substring(1), derivationNonce, derivationLength, tokenTypes);

                if (reader.IsEmptyElement)
                {
                    reader.Read();
                }
                else
                {
                    reader.ReadStartElement();
                    reader.ReadEndElement();
                }
                return(clause);
            }
Beispiel #4
0
        public override bool Matches(SecurityKeyIdentifierClause keyIdentifierClause)
        {
            LocalIdKeyIdentifierClause that = keyIdentifierClause as LocalIdKeyIdentifierClause;

            return(ReferenceEquals(this, that) || (that != null && that.Matches(this.localId, this.OwnerType)));
        }
Beispiel #5
0
            public override Type GetTokenType(SecurityKeyIdentifierClause clause)
            {
                LocalIdKeyIdentifierClause localClause = clause as LocalIdKeyIdentifierClause;

                return(localClause.OwnerType);
            }