PHP Класс ApiAuthorization

Показать файл Открыть проект

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

Метод Описание
__construct ( ) : void Contructor
getConnectId ( ) : string Returns the connectId
getNonce ( ) : string Returns hash based nonce.
getPublicKey ( ) : string Returns the public key
getSignature ( string $service, string $method, string $nonce ) : string Returns the crypted hash signature for the message.
getTimestamp ( ) : string Returns the current REST timestamp.
isSecureApiCall ( ) : boolean Returns message security status.
setConnectId ( string $connectId ) : void Set the connectId
setPublicKey ( string $publicKey ) : void Sets the public key.
setSecretKey ( string $secretKey ) : void Set SecretKey
setSecureApiCall ( $status = false ) : void Enables the API authentication.
setTimestamp ( string $timestamp ) : void Set connectId
setVersion ( string $version ) : void Sets the API version to use.

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

Метод Описание
encodeBase64 ( string $str ) : encoded Encodes the given message parameters with Base64.
hmac ( $mesgparams ) : string Creates secured HMAC signature of the message parameters.

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

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

Contructor
public __construct ( ) : void
Результат void

getConnectId() закрытый публичный Метод

Returns the connectId
final public getConnectId ( ) : string
Результат string zanox connect id

getNonce() закрытый публичный Метод

Returns hash based nonce.
См. также: http://en.wikipedia.org/wiki/Cryptographic_nonce
final public getNonce ( ) : string
Результат string md5 hash-based nonce

getPublicKey() закрытый публичный Метод

Returns the public key
final public getPublicKey ( ) : string
Результат string zanox public key

getSignature() закрытый публичный Метод

Builds the signed string consisting of the rest action verb, the uri used and the timestamp of the message. Be aware of the 15 minutes timeframe when setting the time manually.
final public getSignature ( string $service, string $method, string $nonce ) : string
$service string service name or restful action
$method string method or uri
$nonce string nonce of request
Результат string encoded string

getTimestamp() закрытый публичный Метод

If there hasn't already been set a datetime we create one automatically. As a format the HTTP Header protocol RFC format is taken.
См. также: see HTTP RFC for the datetime format
final public getTimestamp ( ) : string
Результат string message timestamp

isSecureApiCall() закрытый публичный Метод

Method returns true if message needs to signed with crypted hmac string and nonce. Otherwise false is returned.
final public isSecureApiCall ( ) : boolean
Результат boolean true if secure message

setConnectId() закрытый публичный Метод

Set the connectId
final public setConnectId ( string $connectId ) : void
$connectId string zanox connectId
Результат void

setPublicKey() закрытый публичный Метод

Sets the public key.
final public setPublicKey ( string $publicKey ) : void
$publicKey string public key
Результат void

setSecretKey() закрытый публичный Метод

Set SecretKey
final public setSecretKey ( string $secretKey ) : void
$secretKey string zanox secret key
Результат void

setSecureApiCall() закрытый публичный Метод

Authentication is only required and therefore enabled for some privacy related methods like accessing your profile or reports.
final public setSecureApiCall ( $status = false ) : void
Результат void

setTimestamp() закрытый публичный Метод

Set connectId
final public setTimestamp ( string $timestamp ) : void
$timestamp string time stamp
Результат void

setVersion() закрытый публичный Метод

Sets the API version to use.
final public setVersion ( string $version ) : void
$version string API version
Результат void