Credentials
extends AwsCredentialIdentity
in package
implements
CredentialsInterface, Serializable
Basic implementation of the AWS Credentials interface that allows callers to pass in the AWS Access Key and AWS Secret Access Key in the constructor.
Table of Contents
Interfaces
- CredentialsInterface
- Provides access to the AWS credentials used for accessing AWS services: AWS access key ID, secret access key, and security token. These credentials are used to securely sign requests to AWS services.
- Serializable
Methods
- __construct() : mixed
- Constructs a new BasicAWSCredentials object, with the specified AWS access key and AWS secret key
- __serialize() : mixed
- __set_state() : mixed
- __unserialize() : mixed
- getAccessKeyId() : string
- Returns the AWS access key ID for this credentials object.
- getAccountId() : mixed
- getExpiration() : int|null
- Get the UNIX timestamp in which the credentials will expire
- getSecretKey() : string
- Returns the AWS secret access key for this credentials object.
- getSecurityToken() : string|null
- Get the associated security token if available
- isExpired() : bool
- Check if the credentials are expired
- serialize() : mixed
- toArray() : array<string|int, mixed>
- Converts the credentials to an associative array.
- unserialize() : mixed
Methods
__construct()
Constructs a new BasicAWSCredentials object, with the specified AWS access key and AWS secret key
public
__construct(string $key, string $secret[, string $token = null ][, int $expires = null ][, mixed $accountId = null ]) : mixed
Parameters
- $key : string
-
AWS access key ID
- $secret : string
-
AWS secret access key
- $token : string = null
-
Security token to use
- $expires : int = null
-
UNIX timestamp for when credentials expire
- $accountId : mixed = null
__serialize()
public
__serialize() : mixed
__set_state()
public
static __set_state(array<string|int, mixed> $state) : mixed
Parameters
- $state : array<string|int, mixed>
__unserialize()
public
__unserialize(mixed $data) : mixed
Parameters
- $data : mixed
getAccessKeyId()
Returns the AWS access key ID for this credentials object.
public
getAccessKeyId() : string
Return values
stringgetAccountId()
public
getAccountId() : mixed
getExpiration()
Get the UNIX timestamp in which the credentials will expire
public
getExpiration() : int|null
Return values
int|nullgetSecretKey()
Returns the AWS secret access key for this credentials object.
public
getSecretKey() : string
Return values
stringgetSecurityToken()
Get the associated security token if available
public
getSecurityToken() : string|null
Return values
string|nullisExpired()
Check if the credentials are expired
public
isExpired() : bool
Return values
boolserialize()
public
serialize() : mixed
toArray()
Converts the credentials to an associative array.
public
toArray() : array<string|int, mixed>
Return values
array<string|int, mixed>unserialize()
public
unserialize(mixed $serialized) : mixed
Parameters
- $serialized : mixed