EncryptedSecurityTokenHandler.WriteToken(XmlWriter, SecurityToken) Method
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
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
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.