PHP Класс Swift_Transport_Esmtp_Auth_NTLMAuthenticator

Автор: Ward Peeters ([email protected])
Наследование: implements Swift_Transport_Esmtp_Authenticator
Показать файл Открыть проект

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

Метод Описание
authenticate ( Swift_Transport_SmtpAgent $agent, string $username, string $password ) : boolean Try to authenticate the user with $username and $password.
getAuthKeyword ( ) : string Get the name of the AUTH mechanism this Authenticator handles.

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

Метод Описание
castToByte ( integer $v ) : integer Cast to byte java equivalent to (byte).
convertTo16bit ( string $input ) : string Convert UTF-8 to UTF-16.
createBlob ( string $timestamp, string $client, string $targetInfo ) : string
createByte ( string $input, integer $bytes = 4, boolean $isHex = true ) : string Right padding with 0 to certain length.
createDesKey ( $key )
createLMPassword ( string $password, string $challenge ) : string Create LMv1 response.
createLMv2Password ( string $password, string $username, string $domain, string $challenge, string $client ) : string Create LMv2 response.
createMessage1 ( ) : string Create our message 1.
createMessage3 ( string $domain, string $username, string $workstation, string $lmResponse, string $ntlmResponse ) : string Create our message 3.
createNTLMPassword ( string $password, string $challenge ) : string Create NTLMv1 response.
createNTLMv2Hash ( string $password, string $username, string $domain, string $challenge, string $targetInfo, string $timestamp, string $client ) : string Create NTLMv2 response.
createSecurityBuffer ( string $value, integer $offset, boolean $is16 = false ) : string Create our security buffer depending on length and offset.
debug ( string $message )
desEncrypt ( string $value, string $key ) : string DES Encryption.
getCorrectTimestamp ( string $time ) : string Convert a normal timestamp to a tenth of a microtime epoch time.
getDomainAndUsername ( string $name ) : array Get domain and username from our username.
getRandomBytes ( $length ) : string Create random bytes.
md4Encrypt ( string $input ) : string MD4 Encryption.
md5Encrypt ( string $key, string $msg ) : string MD5 Encryption.
parseMessage2 ( string $response ) : array Fetch all details of our response (message 2).
readSecurityBuffer ( string $value ) : array Read our security buffer to fetch length and offset of our value.
readSubBlock ( $block ) : array Read the blob information in from message2.
sendMessage1 ( Swift_Transport_SmtpAgent $agent ) : string Send our auth message and returns the response.
sendMessage3 ( string $response, string $username, string $password, string $timestamp, string $client, Swift_Transport_SmtpAgent $agent, boolean $v2 = true ) : string Send our final message with all our data.
si2bin ( $si, $bits = 32 )
uRShift ( integer $a, integer $b ) : integer Java unsigned right bitwise $a >>> $b.

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

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

Try to authenticate the user with $username and $password.
public authenticate ( Swift_Transport_SmtpAgent $agent, string $username, string $password ) : boolean
$agent Swift_Transport_SmtpAgent
$username string
$password string
Результат boolean

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

Cast to byte java equivalent to (byte).
protected castToByte ( integer $v ) : integer
$v integer
Результат integer

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

Convert UTF-8 to UTF-16.
protected convertTo16bit ( string $input ) : string
$input string
Результат string

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

protected createBlob ( string $timestamp, string $client, string $targetInfo ) : string
$timestamp string Epoch timestamp in microseconds
$client string Random bytes
$targetInfo string
Результат string

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

Right padding with 0 to certain length.
protected createByte ( string $input, integer $bytes = 4, boolean $isHex = true ) : string
$input string
$bytes integer Length of bytes
$isHex boolean Did we provided hex value
Результат string

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

protected createDesKey ( $key )

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

Create LMv1 response.
protected createLMPassword ( string $password, string $challenge ) : string
$password string
$challenge string
Результат string

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

Create LMv2 response.
protected createLMv2Password ( string $password, string $username, string $domain, string $challenge, string $client ) : string
$password string
$username string
$domain string
$challenge string NTLM Challenge
$client string Random string
Результат string

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

Create our message 1.
protected createMessage1 ( ) : string
Результат string

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

Create our message 3.
protected createMessage3 ( string $domain, string $username, string $workstation, string $lmResponse, string $ntlmResponse ) : string
$domain string
$username string
$workstation string
$lmResponse string
$ntlmResponse string
Результат string

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

Create NTLMv1 response.
protected createNTLMPassword ( string $password, string $challenge ) : string
$password string
$challenge string
Результат string

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

Create NTLMv2 response.
См. также: http://davenport.sourceforge.net/ntlm.html#theNtlmResponse
protected createNTLMv2Hash ( string $password, string $username, string $domain, string $challenge, string $targetInfo, string $timestamp, string $client ) : string
$password string
$username string
$domain string
$challenge string Hex values
$targetInfo string Hex values
$timestamp string
$client string Random bytes
Результат string

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

Create our security buffer depending on length and offset.
protected createSecurityBuffer ( string $value, integer $offset, boolean $is16 = false ) : string
$value string Value we want to put in
$offset integer start of value
$is16 boolean Do we 16bit string or not?
Результат string

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

protected debug ( string $message )
$message string

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

DES Encryption.
protected desEncrypt ( string $value, string $key ) : string
$value string An 8-byte string
$key string
Результат string

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

Get the name of the AUTH mechanism this Authenticator handles.
public getAuthKeyword ( ) : string
Результат string

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

Convert a normal timestamp to a tenth of a microtime epoch time.
protected getCorrectTimestamp ( string $time ) : string
$time string
Результат string

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

Get domain and username from our username.
protected getDomainAndUsername ( string $name ) : array
$name string
Результат array

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

Create random bytes.
protected getRandomBytes ( $length ) : string
$length
Результат string

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

MD4 Encryption.
См. также: http://php.net/manual/en/ref.hash.php
protected md4Encrypt ( string $input ) : string
$input string
Результат string

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

MD5 Encryption.
protected md5Encrypt ( string $key, string $msg ) : string
$key string Encryption key
$msg string Message to encrypt
Результат string

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

Fetch all details of our response (message 2).
protected parseMessage2 ( string $response ) : array
$response string
Результат array our response parsed

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

Read our security buffer to fetch length and offset of our value.
protected readSecurityBuffer ( string $value ) : array
$value string Securitybuffer in hex
Результат array array with length and offset

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

Read the blob information in from message2.
protected readSubBlock ( $block ) : array
$block
Результат array

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

Send our auth message and returns the response.
protected sendMessage1 ( Swift_Transport_SmtpAgent $agent ) : string
$agent Swift_Transport_SmtpAgent
Результат string SMTP Response

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

Send our final message with all our data.
protected sendMessage3 ( string $response, string $username, string $password, string $timestamp, string $client, Swift_Transport_SmtpAgent $agent, boolean $v2 = true ) : string
$response string Message 1 response (message 2)
$username string
$password string
$timestamp string
$client string
$agent Swift_Transport_SmtpAgent
$v2 boolean Use version2 of the protocol
Результат string

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

protected si2bin ( $si, $bits = 32 )

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

Java unsigned right bitwise $a >>> $b.
protected uRShift ( integer $a, integer $b ) : integer
$a integer
$b integer
Результат integer