public override void WriteContent(XmlDictionaryWriter writer, SecurityKeyIdentifierClause clause) { writer.WriteStartElement(XD.SecurityJan2004Dictionary.Prefix.Value, XD.SecurityJan2004Dictionary.KeyIdentifier, XD.SecurityJan2004Dictionary.Namespace); writer.WriteAttributeString(XD.SecurityJan2004Dictionary.ValueType, null, ValueTypeUri); if (this.emitBspRequiredAttributes) { // Emit the encodingType attribute. writer.WriteAttributeString(XD.SecurityJan2004Dictionary.EncodingType, null, DefaultEncodingType); } string encoding = DefaultEncodingType; BinaryKeyIdentifierClause binaryClause = clause as BinaryKeyIdentifierClause; byte[] keyIdentifier = binaryClause.GetBuffer(); if (encoding == EncodingTypeValueBase64Binary) { writer.WriteBase64(keyIdentifier, 0, keyIdentifier.Length); } else if (encoding == EncodingTypeValueHexBinary) { writer.WriteBinHex(keyIdentifier, 0, keyIdentifier.Length); } else if (encoding == EncodingTypeValueText) { writer.WriteString(new UTF8Encoding().GetString(keyIdentifier, 0, keyIdentifier.Length)); } writer.WriteEndElement(); }
public override bool Matches(SecurityKeyIdentifierClause keyIdentifierClause) { BinaryKeyIdentifierClause that = keyIdentifierClause as BinaryKeyIdentifierClause; // PreSharp Bug: Parameter 'that' to this public method must be validated: A null-dereference can occur here. #pragma warning suppress 56506 return(ReferenceEquals(this, that) || (that != null && that.Matches(this.identificationData))); }
public override bool Matches(SecurityKeyIdentifierClause keyIdentifierClause) { BinaryKeyIdentifierClause that = keyIdentifierClause as BinaryKeyIdentifierClause; // PreSharp #pragma warning suppress 56506 return(ReferenceEquals(this, that) || (that != null && that.Matches(this.identificationData))); }
public override bool Matches(SecurityKeyIdentifierClause clause) { BinaryKeyIdentifierClause other = clause as BinaryKeyIdentifierClause; if (other == null) { return(false); } return(Matches(other.GetRawBuffer())); }
public override bool Matches(SecurityKeyIdentifierClause keyIdentifierClause) { BinaryKeyIdentifierClause that = keyIdentifierClause as BinaryKeyIdentifierClause; return(ReferenceEquals(this, that) || (that != null && that.Matches(_identificationData))); }
public override bool Matches(SecurityKeyIdentifierClause keyIdentifierClause) { BinaryKeyIdentifierClause objB = keyIdentifierClause as BinaryKeyIdentifierClause; return(object.ReferenceEquals(this, objB) || ((objB != null) && objB.Matches(this.identificationData))); }