SecurityTokenParameters Class

Definition

Specifies an abstract class that when implemented represents security token parameters.

C#
public abstract class SecurityTokenParameters
Inheritance
SecurityTokenParameters
Derived

Examples

The following code shows a custom override of this class called CreditCardTokenParameters.

C#
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");
        }
    }
}

Remarks

Security token parameters provide information about the tokens (for example, token type, issuer, and so on) required by the security binding element.

The security token parameter classes derived from this one are a collection of token properties and methods, and are used in creating different kinds of security binding elements and tokens. Not all of the properties are relevant to all derived classes. For example, the ReferenceStyle has no relevance in an issued token (SAML token) case.

Constructors

SecurityTokenParameters()

Initializes a new instance of the SecurityTokenParameters class.

SecurityTokenParameters(SecurityTokenParameters)

Initializes a new instance of the SecurityTokenParameters class from another instance.

Properties

HasAsymmetricKey

When overridden in a derived class, gets a value that indicates whether the token has an asymmetric key.

InclusionMode

Gets or sets the token inclusion requirements.

ReferenceStyle

Gets or sets the token reference style.

RequireDerivedKeys

Gets or sets a value that indicates whether keys can be derived from the original proof keys.

SupportsClientAuthentication

When overridden in a derived class, gets a value that indicates whether the token supports client authentication.

SupportsClientWindowsIdentity

When overridden in a derived class, gets a value that indicates whether the token supports a Windows identity for authentication.

SupportsServerAuthentication

When overridden in a derived class, gets a value that indicates whether the token supports server authentication.

Methods

Clone()

Clones another instance of this instance of the class.

CloneCore()

Clones another instance of this instance of the class.

CreateKeyIdentifierClause(SecurityToken, SecurityTokenReferenceStyle)

Creates a key identifier clause for a token.

Equals(Object)

Determines whether the specified object is equal to the current object.

(Inherited from Object)
GetHashCode()

Serves as the default hash function.

(Inherited from Object)
GetType()

Gets the Type of the current instance.

(Inherited from Object)
InitializeSecurityTokenRequirement(SecurityTokenRequirement)

When overridden in a derived class, initializes a security token requirement.

MatchesKeyIdentifierClause(SecurityToken, SecurityKeyIdentifierClause, SecurityTokenReferenceStyle)

Indicates whether a token matches a key identifier clause.

MemberwiseClone()

Creates a shallow copy of the current Object.

(Inherited from Object)
ToString()

Displays a text representation of this instance of the class.

ToString()

Returns a string that represents the current object.

(Inherited from Object)

Applies to

Proizvod Verzije
.NET Core 1.0, Core 1.1, 8 (package-provided), 9 (package-provided), 10 (package-provided)
.NET Framework 3.0, 3.5, 4.0, 4.5, 4.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7, 4.7.1, 4.7.2, 4.8, 4.8.1
.NET Standard 2.0 (package-provided)
UWP 10.0