Class AwsBasicCredentials

java.lang.Object
software.amazon.awssdk.auth.credentials.AwsBasicCredentials
All Implemented Interfaces:
AwsCredentials, AwsCredentialsIdentity, Identity

@Immutable public final class AwsBasicCredentials extends Object implements AwsCredentials
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:
  • Method Details

    • create

      public static AwsBasicCredentials create(String accessKeyId, String secretAccessKey)
      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

      public String accessKeyId()
      Retrieve the AWS access key, used to identify the user interacting with AWS.
      Specified by:
      accessKeyId in interface AwsCredentialsIdentity
    • secretAccessKey

      public String secretAccessKey()
      Retrieve the AWS secret access key, used to authenticate the user interacting with AWS.
      Specified by:
      secretAccessKey in interface AwsCredentialsIdentity
    • toString

      public String toString()
      Overrides:
      toString in class Object
    • equals

      public boolean equals(Object o)
      Overrides:
      equals in class Object
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object