SecurityToken.SecurityKeys プロパティ

定義

セキュリティ トークンに関連付けられた暗号化キーを取得します。

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)

プロパティ値

ReadOnlyCollection<SecurityKey>

セキュリティ トークンに関連付けられている一連のキーを含む、ReadOnlyCollection<T> 型の SecurityKey

このトピックで SecurityToken 使用されるコード例は、サンプルから抜粋したものです Custom Token 。 このサンプルでは、Simple Web Tokens (SWT) の処理を有効にするカスタム クラスを提供します。 これには、クラスとクラスの SimpleWebToken 実装、および SWT トークンを SimpleWebTokenHandler サポートする他のクラスが含まれます。 WIF で使用できるこのサンプルとその他のサンプルの詳細と、それらをダウンロードする場所については、 WIF コード サンプル インデックスを参照してください。 次のコードは、プロパティのオーバーライドを SecurityKeys 示しています。

/// <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>() ); 
    }
}

注釈

このプロパティを SecurityKeys 使用して、トークンまたは SOAP メッセージを保護するために、このセキュリティ トークンの暗号化キーを設定します。 キーは、特にトークンまたは SOAP メッセージにデジタル署名または暗号化するために使用できます。

注意 (実装者)

プロパティをオーバーライドする SecurityKeys 必要があります。

適用対象