This documentation is archived and is not being maintained.

SecurityTokenResolver.TryResolveSecurityKey Method

Attempts to retrieve the key that is referenced in the specified key identifier clause.

Namespace:  System.IdentityModel.Selectors
Assembly:  System.IdentityModel (in System.IdentityModel.dll)

public bool TryResolveSecurityKey(
	SecurityKeyIdentifierClause keyIdentifierClause,
	out SecurityKey key


Type: System.IdentityModel.Tokens.SecurityKeyIdentifierClause

A SecurityKeyIdentifierClause to retrieve the key for.

Type: System.IdentityModel.Tokens.SecurityKey%

When this method returns, contains a SecurityKey that contains the key that is referenced in the specified key identifier clause. This parameter is passed uninitialized.

Return Value

Type: System.Boolean
true when a key can be retrieved for the specified key identifier clause; otherwise, false.


keyIdentifierClause is null.

The TryResolveSecurityKey and ResolveSecurityKey methods differ in what happens when the key identifier clause cannot be resolved to a key. The TryResolveSecurityKey method returns false, whereas the ResolveSecurityKey method throws an exception.

Windows 7, Windows Vista, Windows XP SP2, Windows Server 2008 R2, Windows Server 2008, Windows Server 2003

The .NET Framework and .NET Compact Framework do not support all versions of every platform. For a list of the supported versions, see .NET Framework System Requirements.

.NET Framework

Supported in: 3.5, 3.0