C# Класс MailKit.Security.SaslMechanism

A SASL authentication mechanism.
Authenticating via a SASL mechanism may be a multi-step process. To determine if the mechanism has completed the necessary steps to authentication, check the IsAuthenticated after each call to Challenge(string).
Показать файл Открыть проект

Открытые свойства

Свойство Тип Описание
AuthMechanismRank string[]

Открытые методы

Метод Описание
Challenge ( string token ) : string

Decodes the base64-encoded server challenge and returns the next challenge response encoded in base64.

Decodes the base64-encoded server challenge and returns the next challenge response encoded in base64.

Create ( string mechanism, Uri uri, ICredentials credentials ) : SaslMechanism

Create an instance of the specified SASL mechanism using the uri and credentials.

If unsure that a particular SASL mechanism is supported, you should first call IsSupported.

Create ( string mechanism, Uri uri, Portable.Text.Encoding encoding, ICredentials credentials ) : SaslMechanism

Create an instance of the specified SASL mechanism using the uri and credentials.

If unsure that a particular SASL mechanism is supported, you should first call IsSupported.

IsSupported ( string mechanism ) : bool

Determines if the specified SASL mechanism is supported by MailKit.

Use this method to make sure that a SASL mechanism is supported before calling Create(string,Uri,ICredentials).

Reset ( ) : void

Resets the state of the SASL mechanism.

Resets the state of the SASL mechanism.

SaslPrep ( string s ) : string

Prepares the user name or password string.

Prepares a user name or password string according to the rules of rfc4013.

Защищенные методы

Метод Описание
Challenge ( byte token, int startIndex, int length ) : byte[]

Parses the server's challenge token and returns the next challenge response.

Parses the server's challenge token and returns the next challenge response.

SaslMechanism ( Uri uri, ICredentials credentials ) : System

Initializes a new instance of the MailKit.Security.SaslMechanism class.

Creates a new SASL context.

Приватные методы

Метод Описание
IsCommonlyMappedToNothing ( char c ) : bool

Determines if the character is commonly mapped to nothing.

This list was obtained from http://tools.ietf.org/html/rfc3454#appendix-B.1

IsNonAsciiSpace ( char c ) : bool

Determines if the character is a non-ASCII space.

This list was obtained from http://tools.ietf.org/html/rfc3454#appendix-C.1.2

IsProhibited ( string s, int index ) : bool

Determines if the character is prohibited.

This list was obtained from http://tools.ietf.org/html/rfc3454#appendix-C.3

Описание методов

Challenge() защищенный абстрактный Метод

Parses the server's challenge token and returns the next challenge response.
Parses the server's challenge token and returns the next challenge response.
/// The SASL mechanism is already authenticated. /// /// THe SASL mechanism does not support SASL-IR. /// /// An error has occurred while parsing the server's challenge token. ///
protected abstract Challenge ( byte token, int startIndex, int length ) : byte[]
token byte The server's challenge token.
startIndex int The index into the token specifying where the server's challenge begins.
length int The length of the server's challenge.
Результат byte[]

Challenge() публичный Метод

Decodes the base64-encoded server challenge and returns the next challenge response encoded in base64.
Decodes the base64-encoded server challenge and returns the next challenge response encoded in base64.
/// The SASL mechanism is already authenticated. /// /// THe SASL mechanism does not support SASL-IR. /// /// An error has occurred while parsing the server's challenge token. ///
public Challenge ( string token ) : string
token string The server's base64-encoded challenge token.
Результат string

Create() публичный статический Метод

Create an instance of the specified SASL mechanism using the uri and credentials.
If unsure that a particular SASL mechanism is supported, you should first call IsSupported.
/// is null. /// -or- /// is null. /// -or- /// is null. ///
public static Create ( string mechanism, Uri uri, ICredentials credentials ) : SaslMechanism
mechanism string The name of the SASL mechanism.
uri System.Uri The URI of the service to authenticate against.
credentials ICredentials The user's credentials.
Результат SaslMechanism

Create() публичный статический Метод

Create an instance of the specified SASL mechanism using the uri and credentials.
If unsure that a particular SASL mechanism is supported, you should first call IsSupported.
/// is null. /// -or- /// is null. /// -or- /// is null. /// -or- /// is null. ///
public static Create ( string mechanism, Uri uri, Portable.Text.Encoding encoding, ICredentials credentials ) : SaslMechanism
mechanism string The name of the SASL mechanism.
uri System.Uri The URI of the service to authenticate against.
encoding Portable.Text.Encoding The text encoding to use for the credentials.
credentials ICredentials The user's credentials.
Результат SaslMechanism

IsSupported() публичный статический Метод

Determines if the specified SASL mechanism is supported by MailKit.
Use this method to make sure that a SASL mechanism is supported before calling Create(string,Uri,ICredentials).
/// is null. ///
public static IsSupported ( string mechanism ) : bool
mechanism string The name of the SASL mechanism.
Результат bool

Reset() публичный Метод

Resets the state of the SASL mechanism.
Resets the state of the SASL mechanism.
public Reset ( ) : void
Результат void

SaslMechanism() защищенный Метод

Initializes a new instance of the MailKit.Security.SaslMechanism class.
Creates a new SASL context.
/// is null. /// -or- /// is null. ///
protected SaslMechanism ( Uri uri, ICredentials credentials ) : System
uri System.Uri The URI of the service.
credentials ICredentials The user's credentials.
Результат System

SaslPrep() публичный статический Метод

Prepares the user name or password string.
Prepares a user name or password string according to the rules of rfc4013.
/// is null. /// /// contains prohibited characters. ///
public static SaslPrep ( string s ) : string
s string The string to prepare.
Результат string

Описание свойств

AuthMechanismRank публичное статическое свойство

The supported authentication mechanisms in order of strongest to weakest.
Used by the various clients when authenticating via SASL to determine which order the SASL mechanisms supported by the server should be tried.
public static string[] AuthMechanismRank
Результат string[]