SecurityTokenParameters Klasa

Definicja

Określa klasę abstract , która po zaimplementowaniu reprezentuje parametry tokenu zabezpieczającego.

public ref class SecurityTokenParameters abstract
public abstract class SecurityTokenParameters
type SecurityTokenParameters = class
Public MustInherit Class SecurityTokenParameters
Dziedziczenie
SecurityTokenParameters
Pochodne

Przykłady

Poniższy kod przedstawia niestandardowe zastąpienie tej klasy o nazwie CreditCardTokenParameters.

public class CreditCardTokenParameters : SecurityTokenParameters
{
    public CreditCardTokenParameters()
    {
    }

    protected CreditCardTokenParameters(CreditCardTokenParameters other)
        : base(other)
    {
    }

    protected override SecurityTokenParameters CloneCore()
    {
        return new CreditCardTokenParameters(this);
    }

    protected override void InitializeSecurityTokenRequirement(SecurityTokenRequirement requirement)
    {
        requirement.TokenType = Constants.CreditCardTokenType;
        return;
    }

    // A credit card token has no cryptography, no windows identity, and supports only client authentication.
    protected override bool HasAsymmetricKey
    {
        get { return false; }
    }

    protected override bool SupportsClientAuthentication
    {
        get { return true; }
    }

    protected override bool SupportsClientWindowsIdentity
    {
        get { return false; }
    }

    protected override bool SupportsServerAuthentication
    {
        get { return false; }
    }

    protected override SecurityKeyIdentifierClause CreateKeyIdentifierClause(SecurityToken token, SecurityTokenReferenceStyle referenceStyle)
    {
        if (referenceStyle == SecurityTokenReferenceStyle.Internal)
        {
            return token.CreateKeyIdentifierClause<LocalIdKeyIdentifierClause>();
        }
        else
        {
            throw new NotSupportedException("External references are not supported for credit card tokens");
        }
    }
}
Public Class CreditCardTokenParameters
    Inherits SecurityTokenParameters

    Public Sub New()
    End Sub

    Protected Sub New(ByVal other As CreditCardTokenParameters)
        MyBase.New(other)
    End Sub

    Protected Overrides Function CloneCore() As SecurityTokenParameters
        Return New CreditCardTokenParameters(Me)
    End Function

    Protected Overrides Sub InitializeSecurityTokenRequirement(ByVal requirement As SecurityTokenRequirement)
        requirement.TokenType = Constants.CreditCardTokenType
        Return
    End Sub

    ' A credit card token has no cryptography, no windows identity, and supports only client authentication.
    Protected Overrides ReadOnly Property HasAsymmetricKey() As Boolean
        Get
            Return False
        End Get
    End Property

    Protected Overrides ReadOnly Property SupportsClientAuthentication() As Boolean
        Get
            Return True
        End Get
    End Property

    Protected Overrides ReadOnly Property SupportsClientWindowsIdentity() As Boolean
        Get
            Return False
        End Get
    End Property

    Protected Overrides ReadOnly Property SupportsServerAuthentication() As Boolean
        Get
            Return False
        End Get
    End Property

    Protected Overrides Function CreateKeyIdentifierClause(ByVal token As SecurityToken, _
                                                           ByVal referenceStyle As SecurityTokenReferenceStyle) As SecurityKeyIdentifierClause
        If referenceStyle = SecurityTokenReferenceStyle.Internal Then
            Return token.CreateKeyIdentifierClause(Of LocalIdKeyIdentifierClause)()
        Else
            Throw New NotSupportedException("External references are not supported for credit card tokens")
        End If
    End Function

End Class

Uwagi

Parametry tokenu zabezpieczającego zawierają informacje o tokenach (na przykład typ tokenu, wystawca itd.) wymaganych przez element powiązania zabezpieczeń.

Klasy parametrów tokenu zabezpieczającego pochodzące z tej klasy są kolekcją właściwości i metod tokenu oraz są używane w tworzeniu różnych rodzajów elementów powiązań zabezpieczeń i tokenów. Nie wszystkie właściwości są istotne dla wszystkich klas pochodnych. Na przykład argument ReferenceStyle nie ma istotności w przypadku wystawionego tokenu (token SAML).

Konstruktory

SecurityTokenParameters()

Inicjuje nowe wystąpienie klasy SecurityTokenParameters.

SecurityTokenParameters(SecurityTokenParameters)

Inicjuje SecurityTokenParameters nowe wystąpienie klasy z innego wystąpienia.

Właściwości

HasAsymmetricKey

Po zastąpieniu w klasie pochodnej pobiera wartość wskazującą, czy token ma klucz asymetryczny.

InclusionMode

Pobiera lub ustawia wymagania dotyczące dołączania tokenów.

ReferenceStyle

Pobiera lub ustawia styl odwołania do tokenu.

RequireDerivedKeys

Pobiera lub ustawia wartość wskazującą, czy klucze mogą pochodzić z oryginalnych kluczy dowodowych.

SupportsClientAuthentication

Po zastąpieniu w klasie pochodnej pobiera wartość wskazującą, czy token obsługuje uwierzytelnianie klienta.

SupportsClientWindowsIdentity

Po zastąpieniu w klasie pochodnej pobiera wartość wskazującą, czy token obsługuje tożsamość systemu Windows na potrzeby uwierzytelniania.

SupportsServerAuthentication

Po zastąpieniu w klasie pochodnej pobiera wartość wskazującą, czy token obsługuje uwierzytelnianie serwera.

Metody

Clone()

Klonuje inne wystąpienie tej klasy.

CloneCore()

Klonuje inne wystąpienie tej klasy.

CreateKeyIdentifierClause(SecurityToken, SecurityTokenReferenceStyle)

Tworzy klauzulę identyfikatora klucza dla tokenu.

Equals(Object)

Określa, czy dany obiekt jest taki sam, jak bieżący obiekt.

(Odziedziczone po Object)
GetHashCode()

Służy jako domyślna funkcja skrótu.

(Odziedziczone po Object)
GetType()

Type Pobiera wartość bieżącego wystąpienia.

(Odziedziczone po Object)
InitializeSecurityTokenRequirement(SecurityTokenRequirement)

Podczas zastępowania w klasie pochodnej inicjuje wymaganie tokenu zabezpieczającego.

MatchesKeyIdentifierClause(SecurityToken, SecurityKeyIdentifierClause, SecurityTokenReferenceStyle)

Wskazuje, czy token jest zgodny z klauzulą identyfikatora klucza.

MemberwiseClone()

Tworzy płytkią kopię bieżącego Objectelementu .

(Odziedziczone po Object)
ToString()

Wyświetla tekstową reprezentację tego wystąpienia klasy.

ToString()

Zwraca ciąg reprezentujący bieżący obiekt.

(Odziedziczone po Object)

Dotyczy