Download the PHP package krak/hmac without Composer
On this page you can find all versions of the php package krak/hmac. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Informations about the package hmac
Hmac
Hmac is a library for handling hmac authentication. Look at the source code for documentation.
Usage
HmacConfig
The HmacConfig
is passed at creation to the signer and authenticator to allow total configuration of how the request is authed or signed. The same config needs to be provided to the sign and the auth for them to inverse each other.
Here are the options:
Signers
hmac_sign_request
is the default signer which creates sign function that accepts an HmacRequest
and HmacKeyPair
.
hmac_psr7_sign_request
is a decorated signer around the hmac_sign_request for accepting and returning Psr Http Requests. It simply just wraps hmac_sign_request
around the hmac_psr7_sign
decorator.
hmac_psr7_sign
is a decorator sign function that accepts a sign function and wraps it and returns a sign function that will accept and return Psr Http Requests.
Hash String Generator
The hash string generators are functions that take the request and time value and generate the string that will end up being hashed.
provided hs_gen
funcs:
// returns a hs_gen that will md5 hash the content and join everything by the given separator
hmac_hashed_hs_gen($sep = "\n");
example:
Time Generator
A time generator is just used to generate a time unit like a timestamp or date stamp.
provided time_gen
funcs:
// returns the `time` function which creates a unix timestamp
hmac_ts_time_gen();
// returns a time_gen which creates an RFC 2822 formatted date
hmac_date_time_gen();
Integration
GuzzleHttp
Simple integration with Guzzle can be done via the Provider/guzzle.php
functions.