SignatureV2
extends AbstractSignature
in package
Implementation of Signature Version 2
Tags
Table of Contents
Methods
- addParameter() : mixed
- Add a parameter key and value to the request according to type
- createPresignedUrl() : string
- Create a pre-signed URL
- signRequest() : mixed
- Signs the specified request with an AWS signing protocol by using the provided AWS account credentials and adding the required headers to the request.
- getTimestamp() : int
- Provides the timestamp used for the class (used for mocking PHP's time() function)
- getCanonicalizedParameterString() : string
- Get the canonicalized query/parameter string for a request
Methods
addParameter()
Add a parameter key and value to the request according to type
public
addParameter(RequestInterface $request, string $key, string $value) : mixed
Parameters
- $request : RequestInterface
-
The request
- $key : string
-
The name of the parameter
- $value : string
-
The value of the parameter
createPresignedUrl()
Create a pre-signed URL
public
createPresignedUrl(RequestInterface $request, CredentialsInterface $credentials, mixed $expires) : string
Parameters
- $request : RequestInterface
-
Request to sign
- $credentials : CredentialsInterface
-
Credentials used to sign
- $expires : mixed
-
The time at which the URL should expire. This can be a Unix timestamp, a PHP DateTime object, or a string that can be evaluated by strtotime
Tags
Return values
stringsignRequest()
Signs the specified request with an AWS signing protocol by using the provided AWS account credentials and adding the required headers to the request.
public
signRequest(RequestInterface $request, CredentialsInterface $credentials) : mixed
Parameters
- $request : RequestInterface
-
Request to add a signature to
- $credentials : CredentialsInterface
-
Signing credentials
getTimestamp()
Provides the timestamp used for the class (used for mocking PHP's time() function)
protected
getTimestamp() : int
Return values
intgetCanonicalizedParameterString()
Get the canonicalized query/parameter string for a request
private
getCanonicalizedParameterString(RequestInterface $request) : string
Parameters
- $request : RequestInterface
-
Request used to build canonicalized string