SecurityToken.SecurityKeys Właściwość

Definicja

Pobiera klucze kryptograficzne skojarzone z tokenem zabezpieczającym.

public:
 abstract property System::Collections::ObjectModel::ReadOnlyCollection<System::IdentityModel::Tokens::SecurityKey ^> ^ SecurityKeys { System::Collections::ObjectModel::ReadOnlyCollection<System::IdentityModel::Tokens::SecurityKey ^> ^ get(); };
public abstract System.Collections.ObjectModel.ReadOnlyCollection<System.IdentityModel.Tokens.SecurityKey> SecurityKeys { get; }
member this.SecurityKeys : System.Collections.ObjectModel.ReadOnlyCollection<System.IdentityModel.Tokens.SecurityKey>
Public MustOverride ReadOnly Property SecurityKeys As ReadOnlyCollection(Of SecurityKey)

Wartość właściwości

ReadOnlyCollection<SecurityKey>

SecurityKey Typ ReadOnlyCollection<T> zawierający zestaw kluczy skojarzonych z tokenem zabezpieczającym.

Przykłady

Przykłady kodu używane w tematach SecurityToken pochodzą z przykładu Custom Token . Ten przykład zawiera klasy niestandardowe, które umożliwiają przetwarzanie prostych tokenów internetowych (SWT). Obejmuje implementację SimpleWebToken klasy i SimpleWebTokenHandler klasy, a także inne klasy, które obsługują tokeny SWT. Aby uzyskać informacje o tym przykładzie i innych przykładach dostępnych dla programu WIF oraz o tym, gdzie je pobrać, zobacz Przykładowy indeks kodu programu WIF. Poniższy kod przedstawia zastąpienie SecurityKeys właściwości .

/// <summary>
/// Defines the set of constants for the Simple Web Token.
/// </summary>
public static class SimpleWebTokenConstants
{
    public const string Audience = "Audience";
    public const string ExpiresOn = "ExpiresOn";
    public const string Id = "Id";
    public const string Issuer = "Issuer";
    public const string Signature = "HMACSHA256";
    public const string ValidFrom = "ValidFrom";
    public const string ValueTypeUri = "http://schemas.xmlsoap.org/ws/2009/11/swt-token-profile-1.0";     
}
public static DateTime SwtBaseTime = new DateTime( 1970, 1, 1, 0, 0, 0, 0 ); // per SWT psec

NameValueCollection _properties;
/// <summary>
/// Gets the keys associated with this token.
/// </summary>
/// <value>The keys associated with this token.</value>
public override ReadOnlyCollection<SecurityKey> SecurityKeys
{
    get 
    { 
        return new ReadOnlyCollection<SecurityKey>( new List<SecurityKey>() ); 
    }
}

Uwagi

SecurityKeys Użyj właściwości , aby ustawić klucze kryptograficzne dla tego tokenu zabezpieczającego w celu ochrony tokenów lub komunikatu PROTOKOŁU SOAP. Klucze mogą być używane między innymi do cyfrowego podpisywania lub szyfrowania tokenów lub komunikatów protokołu SOAP.

Uwagi dotyczące implementowania

Należy zastąpić SecurityKeys właściwość .

Dotyczy