Table of Contents

Class SimpleWebSecurityTokenSerializer

Namespace
Microsoft.ServiceBus
Assembly
Microsoft.ServiceBus.dll

Represents a class to use to read and to write SimpleWebSecurityToken, System.IdentityModel.Tokens.SecurityKeyIdentifierClause, and System.IdentityModel.Tokens.SecurityKeyIdentifier objects as XML.

public class SimpleWebSecurityTokenSerializer : SecurityTokenSerializer
Inheritance
SimpleWebSecurityTokenSerializer

Constructors

SimpleWebSecurityTokenSerializer()

Initializes a new instance of the SimpleWebSecurityTokenSerializer class.

public SimpleWebSecurityTokenSerializer()

SimpleWebSecurityTokenSerializer(SecurityTokenSerializer)

Constructor.

public SimpleWebSecurityTokenSerializer(SecurityTokenSerializer innerSerializer)

Parameters

innerSerializer SecurityTokenSerializer

A SecurityTokenSerializer to wrap. Typically the default WCF serializer

Fields

DefaultInstance

Specifies an instance of theSimpleWebSecurityTokenSerializer class.

public static readonly SimpleWebSecurityTokenSerializer DefaultInstance

Field Value

SimpleWebSecurityTokenSerializer

Methods

CanReadKeyIdentifierClauseCore(XmlReader)

Determines whether this serializer can read the <KeyIdentifier> element referred by the specified XML reader.

protected override bool CanReadKeyIdentifierClauseCore(XmlReader reader)

Parameters

reader XmlReader

An System.Xml.XmlReader to read the key identifier clause.

Returns

bool

true when the specified <KeyIdentifier> element can be read; otherwise, false.

CanReadKeyIdentifierCore(XmlReader)

Determines whether this serializer can read the <KeyIdentifier> element referred by the specified XML reader.

protected override bool CanReadKeyIdentifierCore(XmlReader reader)

Parameters

reader XmlReader

An System.Xml.XmlReader to read the key identifier.

Returns

bool

true when the specified <KeyIdentifier> element can be read; otherwise, false.

CanReadTokenCore(XmlReader)

Determines whether this serializer can read the security token pointed at by the specified XML reader.

protected override bool CanReadTokenCore(XmlReader reader)

Parameters

reader XmlReader

An System.Xml.XmlReader to read the security token.

Returns

bool

true when the security token can be read; otherwise, false.

CanWriteKeyIdentifierClauseCore(SecurityKeyIdentifierClause)

Determines whether this serializer can write the specified key identifier clause.

protected override bool CanWriteKeyIdentifierClauseCore(SecurityKeyIdentifierClause keyIdentifierClause)

Parameters

keyIdentifierClause SecurityKeyIdentifierClause

A System.IdentityModel.Tokens.SecurityKeyIdentifierClause that represents the key identifier clause to write.

Returns

bool

true when this serializer can write the specified key identifier clause; otherwise, false.

CanWriteKeyIdentifierCore(SecurityKeyIdentifier)

Determines whether this serializer can write the specified key identifier.

protected override bool CanWriteKeyIdentifierCore(SecurityKeyIdentifier keyIdentifier)

Parameters

keyIdentifier SecurityKeyIdentifier

A System.IdentityModel.Tokens.SecurityKeyIdentifier that represents the key identifier to write.

Returns

bool

true when this serializer can write the specified key identifier; otherwise, false.

CanWriteTokenCore(SecurityToken)

Determines whether this serializer can write the specified security token to XML.

protected override bool CanWriteTokenCore(SecurityToken token)

Parameters

token SecurityToken

The System.IdentityModel.Tokens.SecurityToken to convert to XML.

Returns

bool

true when the security token can be written; otherwise, false.

ReadKeyIdentifierClauseCore(XmlReader)

Reads the key identifier clause using the specified XML reader.

protected override SecurityKeyIdentifierClause ReadKeyIdentifierClauseCore(XmlReader reader)

Parameters

reader XmlReader

An System.Xml.XmlReader to read the key identifier clause.

Returns

SecurityKeyIdentifierClause

A System.IdentityModel.Tokens.SecurityKeyIdentifierClause that represents the key identifier that is read.

ReadKeyIdentifierCore(XmlReader)

Reads the key identifier using the specified XML reader.

protected override SecurityKeyIdentifier ReadKeyIdentifierCore(XmlReader reader)

Parameters

reader XmlReader

An System.Xml.XmlReader to read the key identifier.

Returns

SecurityKeyIdentifier

A System.IdentityModel.Tokens.SecurityKeyIdentifier that represents the key identifier that is read.

ReadTokenCore(XmlReader, SecurityTokenResolver)

Reads theSimpleWebSecurityToken or the security token pointed at by the specified XML reader.

protected override SecurityToken ReadTokenCore(XmlReader reader, SecurityTokenResolver tokenResolver)

Parameters

reader XmlReader

An System.Xml.XmlReader to read the SimpleWebSecurityToken or the security token.

tokenResolver SecurityTokenResolver

A System.IdentityModel.Selectors.SecurityTokenResolver that determines the security token type.

Returns

SecurityToken

ASystem.IdentityModel.Tokens.SecurityToken that represents the SimpleWebSecurityToken or the security token that is read.

Exceptions

NotSupportedException

The encoding of the XML element is not base64Binary.

WriteKeyIdentifierClauseCore(XmlWriter, SecurityKeyIdentifierClause)

Writes the specified key identifier clause using the specified XML writer.

protected override void WriteKeyIdentifierClauseCore(XmlWriter writer, SecurityKeyIdentifierClause keyIdentifierClause)

Parameters

writer XmlWriter

An System.Xml.XmlWriter used to write the key identifier clause.

keyIdentifierClause SecurityKeyIdentifierClause

A System.IdentityModel.Tokens.SecurityKeyIdentifierClause that represents the key identifier clause to write.

WriteKeyIdentifierCore(XmlWriter, SecurityKeyIdentifier)

Writes the specified key identifier using the specified XML writer.

protected override void WriteKeyIdentifierCore(XmlWriter writer, SecurityKeyIdentifier keyIdentifier)

Parameters

writer XmlWriter

An System.Xml.XmlWriter used to write the key identifier.

keyIdentifier SecurityKeyIdentifier

A System.IdentityModel.Tokens.SecurityKeyIdentifier that represents the key identifier to write.

Exceptions

InvalidOperationException

The binary token content is null.

WriteTokenCore(XmlWriter, SecurityToken)

Writes the specifiedSimpleWebSecurityToken or security token using the specified XML writer.

protected override void WriteTokenCore(XmlWriter writer, SecurityToken token)

Parameters

writer XmlWriter

An System.Xml.XmlWriter used to write the SimpleWebSecurityToken or security token.

token SecurityToken

The SimpleWebSecurityToken or security token to write.