interface SignBlobInterface implements FetchAuthTokenInterface (View source)

Describes a class which supports signing arbitrary strings.

Methods

array
fetchAuthToken(callable $httpHandler = null)

Fetches the auth tokens based on the current state.

string
getCacheKey()

Obtains a key that can used to cache the results of #fetchAuthToken.

null|array
getLastReceivedToken()

Returns an associative array with the token and expiration time.

string
signBlob(string $stringToSign, bool $forceOpenssl = false)

Sign a string using the method which is best for a given credentials type.

string
getClientName(callable $httpHandler = null)

Returns the current Client Name.

Details

array fetchAuthToken(callable $httpHandler = null)

Fetches the auth tokens based on the current state.

Parameters

callable $httpHandler

callback which delivers psr7 request

Return Value

array

a hash of auth tokens

string getCacheKey()

Obtains a key that can used to cache the results of #fetchAuthToken.

If the value is empty, the auth token is not cached.

Return Value

string

a key that may be used to cache the auth token.

null|array getLastReceivedToken()

Returns an associative array with the token and expiration time.

Return Value

null|array

{ The last received access token.

@type string $access_token The access token string.
@type int $expires_at The time the token expires as a UNIX timestamp.

}

string signBlob(string $stringToSign, bool $forceOpenssl = false)

Sign a string using the method which is best for a given credentials type.

Parameters

string $stringToSign

The string to sign.

bool $forceOpenssl

Require use of OpenSSL for local signing. Does not apply to signing done using external services. Defaults to false.

Return Value

string

The resulting signature. Value should be base64-encoded.

string getClientName(callable $httpHandler = null)

Returns the current Client Name.

Parameters

callable $httpHandler

callback which delivers psr7 request, if one is required to obtain a client name.

Return Value

string