GenericXmlSecurityToken 类

定义

表示基于 XML 的安全令牌。Represents a security token that is based upon XML.

public ref class GenericXmlSecurityToken : System::IdentityModel::Tokens::SecurityToken
public class GenericXmlSecurityToken : System.IdentityModel.Tokens.SecurityToken
type GenericXmlSecurityToken = class
    inherit SecurityToken
Public Class GenericXmlSecurityToken
Inherits SecurityToken
继承
GenericXmlSecurityToken

注解

如果在网络上接收到规范中未定义的令牌,或无法确定安全令牌的类型,则使用 GenericXmlSecurityToken 类。Use the GenericXmlSecurityToken class when you receive a token over the wire that is not defined in a specification or there is no way for you to determine the type of the security token. 例如,在联合方案下,向安全令牌服务 (STS) 发送请求安全令牌 (RST) 时,并不总是知道 STS 将返回哪种类型的安全令牌。For example, in a federation scenario when you send a Request Security Token (RST) to a Security Token Service (STS) you do not always know the type of the security token returned by the STS. 在这种情况下,可以使用 GenericXmlSecurityToken 将安全令牌及其内部引用和外部引用存储为 XML。In such cases, you can use a GenericXmlSecurityToken to store the security token as XML along with its internal and external references.

如果内置安全令牌之一不满足需要,则使用 GenericXmlSecurityToken 类和 XML 来定义声明。Use the GenericXmlSecurityToken class to define claims using XML when one of the built-in security tokens does not suffice. 其他安全令牌可以使用 XML 来定义其声明,但 GenericXmlSecurityToken 安全令牌通常允许安全令牌具有应用程序定义的 XML 集。Other security tokens can define their claims using XML, however the GenericXmlSecurityToken security token generically allows a security token to have an application-defined set of XML.

构造函数

GenericXmlSecurityToken(XmlElement, SecurityToken, DateTime, DateTime, SecurityKeyIdentifierClause, SecurityKeyIdentifierClause, ReadOnlyCollection<IAuthorizationPolicy>)

初始化 GenericXmlSecurityToken 类的新实例。Initializes a new instance of the GenericXmlSecurityToken class.

属性

AuthorizationPolicies

获取此安全令牌的授权策略集合。Gets the collection of authorization policies for this security token.

ExternalTokenReference

获取当此安全令牌未包含在引用它的 SOAP 消息内时引用此安全令牌的安全密钥标识符子句。Gets a security key identifier clause that references this security token when this security token is not included in the SOAP message in which it is referenced.

Id

获取安全令牌的唯一标识符。Gets a unique identifier of the security token.

InternalTokenReference

获取当此安全令牌包含在引用它的 SOAP 消息内时引用此安全令牌的安全密钥标识符子句。Gets a security key identifier clause that references this security token when this security token is included in the SOAP message in which it is referenced.

ProofToken

获取安全令牌的证明令牌。Gets the proof token for the security token.

SecurityKeys

获取与证明令牌相关联的加密密钥。Gets the cryptographic keys associated with the proof token.

TokenXml

获取与安全令牌相关联的 XML。Gets the XML that is associated with the security token.

ValidFrom

获取此安全令牌有效的最初时刻。Gets the first instant in time at which this security token is valid.

ValidTo

获取此安全令牌有效的最后时刻。Gets the last instant in time at which this security token is valid.

方法

CanCreateKeyIdentifierClause<T>()

获取一个值,该值指示此安全令牌能否创建指定的密钥标识符子句。Gets a value that indicates whether this security token is capable of creating the specified key identifier clause.

CanCreateKeyIdentifierClause<T>()

获取一个值,该值指示此安全令牌能否创建指定的密钥标识符。Gets a value that indicates whether this security token is capable of creating the specified key identifier.

(继承自 SecurityToken)
CreateKeyIdentifierClause<T>()

创建指定的密钥标识符子句。Creates the specified key identifier clause.

CreateKeyIdentifierClause<T>()

创建指定的密钥标识符子句。Creates the specified key identifier clause.

(继承自 SecurityToken)
Equals(Object)

确定指定对象是否等于当前对象。Determines whether the specified object is equal to the current object.

(继承自 Object)
GetHashCode()

作为默认哈希函数。Serves as the default hash function.

(继承自 Object)
GetType()

获取当前实例的 TypeGets the Type of the current instance.

(继承自 Object)
MatchesKeyIdentifierClause(SecurityKeyIdentifierClause)

返回一个值,该值指示此实例的密钥标识符是否等于指定的密钥标识符。Returns a value that indicates whether the key identifier for this instance is equal to the specified key identifier.

MatchesKeyIdentifierClause(SecurityKeyIdentifierClause)

返回一个值,该值指示此实例的密钥标识符能否解析为指定的密钥标识符。Returns a value that indicates whether the key identifier for this instance can be resolved to the specified key identifier.

(继承自 SecurityToken)
MemberwiseClone()

创建当前 Object 的浅表副本。Creates a shallow copy of the current Object.

(继承自 Object)
ResolveKeyIdentifierClause(SecurityKeyIdentifierClause)

为指定的密钥标识符子句获取密钥。Gets the key for the specified key identifier clause.

(继承自 SecurityToken)
ToString()

返回当前对象。Returns the current object.

ToString()

返回表示当前对象的字符串。Returns a string that represents the current object.

(继承自 Object)

适用于