Class AwsBasicCredentials
java.lang.Object
software.amazon.awssdk.auth.credentials.AwsBasicCredentials
- All Implemented Interfaces:
AwsCredentials
,AwsCredentialsIdentity
,Identity
,ToCopyableBuilder<AwsBasicCredentials.Builder,
AwsBasicCredentials>
@Immutable
public final class AwsBasicCredentials
extends Object
implements AwsCredentials, ToCopyableBuilder<AwsBasicCredentials.Builder,AwsBasicCredentials>
Provides access to the AWS credentials used for accessing services: AWS access key ID and secret access key. These
credentials are used to securely sign requests to services (e.g., AWS services) that use them for authentication.
For more details on AWS access keys, see: https://docs.aws.amazon.com/general/latest/gr/aws-sec-cred-types.html#access-keys-and-secret-access-keys
- See Also:
-
Nested Class Summary
Modifier and TypeClassDescriptionstatic final class
A builder for creating an instance ofAwsBasicCredentials
. -
Method Summary
Modifier and TypeMethodDescriptionRetrieve the AWS access key, used to identify the user interacting with AWS.Retrieve the AWS account id associated with this credentials identity, if found.static AwsBasicCredentials.Builder
builder()
copy
(Consumer<? super AwsBasicCredentials.Builder> modifier) A convenience method for callingToCopyableBuilder.toBuilder()
, updating the returned builder and then callingSdkBuilder.build()
.static AwsBasicCredentials
Constructs a new credentials object, with the specified AWS access key and AWS secret key.boolean
int
hashCode()
The name of the identity provider that created this credential identity.Retrieve the AWS secret access key, used to authenticate the user interacting with AWS.Take this object and create a builder that contains all of the current property values of this object.toString()
Methods inherited from interface software.amazon.awssdk.identity.spi.Identity
expirationTime
-
Method Details
-
builder
-
create
Constructs a new credentials object, with the specified AWS access key and AWS secret key.- Parameters:
accessKeyId
- The AWS access key, used to identify the user interacting with AWS.secretAccessKey
- The AWS secret access key, used to authenticate the user interacting with AWS.
-
accessKeyId
Retrieve the AWS access key, used to identify the user interacting with AWS.- Specified by:
accessKeyId
in interfaceAwsCredentialsIdentity
-
secretAccessKey
Retrieve the AWS secret access key, used to authenticate the user interacting with AWS.- Specified by:
secretAccessKey
in interfaceAwsCredentialsIdentity
-
providerName
The name of the identity provider that created this credential identity.- Specified by:
providerName
in interfaceIdentity
-
accountId
Retrieve the AWS account id associated with this credentials identity, if found.- Specified by:
accountId
in interfaceAwsCredentialsIdentity
-
toString
-
equals
-
hashCode
public int hashCode() -
toBuilder
Description copied from interface:ToCopyableBuilder
Take this object and create a builder that contains all of the current property values of this object.- Specified by:
toBuilder
in interfaceToCopyableBuilder<AwsBasicCredentials.Builder,
AwsBasicCredentials> - Returns:
- a builder for type T
-
copy
Description copied from interface:ToCopyableBuilder
A convenience method for callingToCopyableBuilder.toBuilder()
, updating the returned builder and then callingSdkBuilder.build()
. This is useful for making small modifications to the existing object.- Specified by:
copy
in interfaceToCopyableBuilder<AwsBasicCredentials.Builder,
AwsBasicCredentials> - Parameters:
modifier
- A function that mutates this immutable object using the provided builder.- Returns:
- A new copy of this object with the requested modifications.
-