SecurityTokenResolver.TryResolveSecurityKey Metoda

Definicja

Próbuje pobrać klucz, do którego odwołuje się określona klauzula identyfikatora klucza.

public:
 bool TryResolveSecurityKey(System::IdentityModel::Tokens::SecurityKeyIdentifierClause ^ keyIdentifierClause, [Runtime::InteropServices::Out] System::IdentityModel::Tokens::SecurityKey ^ % key);
public bool TryResolveSecurityKey (System.IdentityModel.Tokens.SecurityKeyIdentifierClause keyIdentifierClause, out System.IdentityModel.Tokens.SecurityKey key);
member this.TryResolveSecurityKey : System.IdentityModel.Tokens.SecurityKeyIdentifierClause * SecurityKey -> bool
Public Function TryResolveSecurityKey (keyIdentifierClause As SecurityKeyIdentifierClause, ByRef key As SecurityKey) As Boolean

Parametry

keyIdentifierClause
SecurityKeyIdentifierClause

A SecurityKeyIdentifierClause do pobrania klucza dla.

key
SecurityKey

Gdy ta metoda zostanie zwrócona, zawiera SecurityKey element zawierający klucz, do którego odwołuje się klauzula określonego identyfikatora klucza. Ten parametr jest przekazywany jako niezainicjowany.

Zwraca

true gdy klucz można pobrać dla określonej klauzuli identyfikatora klucza; w przeciwnym razie , false.

Wyjątki

keyIdentifierClause to null.

Uwagi

Metody TryResolveSecurityKey i ResolveSecurityKey różnią się tym, co się dzieje, gdy nie można rozpoznać klauzuli identyfikatora klucza jako klucza. Metoda TryResolveSecurityKey zwraca falsemetodę , natomiast ResolveSecurityKey metoda zgłasza wyjątek.

Dotyczy