PHP Class ApiAuthorization

Afficher le fichier Open project: fubralimited/php-oara

Méthodes publiques

Méthode Description
__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.

Private Methods

Méthode Description
encodeBase64 ( string $str ) : encoded Encodes the given message parameters with Base64.
hmac ( $mesgparams ) : string Creates secured HMAC signature of the message parameters.

Method Details

__construct() public méthode

Contructor
public __construct ( ) : void
Résultat void

getConnectId() final public méthode

Returns the connectId
final public getConnectId ( ) : string
Résultat string zanox connect id

getNonce() final public méthode

Returns hash based nonce.
See also: http://en.wikipedia.org/wiki/Cryptographic_nonce
final public getNonce ( ) : string
Résultat string md5 hash-based nonce

getPublicKey() final public méthode

Returns the public key
final public getPublicKey ( ) : string
Résultat string zanox public key

getSignature() final public méthode

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
Résultat string encoded string

getTimestamp() final public méthode

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 also: see HTTP RFC for the datetime format
final public getTimestamp ( ) : string
Résultat string message timestamp

isSecureApiCall() final public méthode

Method returns true if message needs to signed with crypted hmac string and nonce. Otherwise false is returned.
final public isSecureApiCall ( ) : boolean
Résultat boolean true if secure message

setConnectId() final public méthode

Set the connectId
final public setConnectId ( string $connectId ) : void
$connectId string zanox connectId
Résultat void

setPublicKey() final public méthode

Sets the public key.
final public setPublicKey ( string $publicKey ) : void
$publicKey string public key
Résultat void

setSecretKey() final public méthode

Set SecretKey
final public setSecretKey ( string $secretKey ) : void
$secretKey string zanox secret key
Résultat void

setSecureApiCall() final public méthode

Authentication is only required and therefore enabled for some privacy related methods like accessing your profile or reports.
final public setSecureApiCall ( $status = false ) : void
Résultat void

setTimestamp() final public méthode

Set connectId
final public setTimestamp ( string $timestamp ) : void
$timestamp string time stamp
Résultat void

setVersion() final public méthode

Sets the API version to use.
final public setVersion ( string $version ) : void
$version string API version
Résultat void