Redigera

Dela via


EncryptedSecurityTokenHandler.WriteToken(XmlWriter, SecurityToken) Method

Definition

Writes an encrypted security token using the XML writer.

public:
 override void WriteToken(System::Xml::XmlWriter ^ writer, System::IdentityModel::Tokens::SecurityToken ^ token);
public override void WriteToken (System.Xml.XmlWriter writer, System.IdentityModel.Tokens.SecurityToken token);
override this.WriteToken : System.Xml.XmlWriter * System.IdentityModel.Tokens.SecurityToken -> unit
Public Overrides Sub WriteToken (writer As XmlWriter, token As SecurityToken)

Parameters

writer
XmlWriter

The XML writer to which to write the encrypted token.

token
SecurityToken

The encrypted security token, must be an instance of EncryptedSecurityToken.

Exceptions

writer is null.

-or-

token is null.

token is not assignable as EncryptedSecurityToken.

The Configuration property is null. This property is required for obtaining keys for encryption.

-or-

The token handler collection returned by the ContainingCollection property was unable to find a SecurityTokenHandler that can write the SecurityToken returned by the Token property.

The SecurityKey property is not assignable as SymmetricSecurityKey.

Applies to