Class Credentials

java.lang.Object
com.amazonaws.services.securitytoken.model.Credentials
All Implemented Interfaces:
Serializable, Cloneable

public class Credentials extends Object implements Serializable, Cloneable

AWS credentials for API authentication.

See Also:
  • Constructor Details

    • Credentials

      public Credentials()
      Default constructor for Credentials object. Callers should use the setter or fluent setter (with...) methods to initialize the object after creating it.
    • Credentials

      public Credentials(String accessKeyId, String secretAccessKey, String sessionToken, Date expiration)
      Constructs a new Credentials object. Callers should use the setter or fluent setter (with...) methods to initialize any additional object members.
      Parameters:
      accessKeyId - The access key ID that identifies the temporary security credentials.
      secretAccessKey - The secret access key that can be used to sign requests.
      sessionToken - The token that users must pass to the service API to use the temporary credentials.
      expiration - The date on which the current credentials expire.
  • Method Details

    • setAccessKeyId

      public void setAccessKeyId(String accessKeyId)

      The access key ID that identifies the temporary security credentials.

      Parameters:
      accessKeyId - The access key ID that identifies the temporary security credentials.
    • getAccessKeyId

      public String getAccessKeyId()

      The access key ID that identifies the temporary security credentials.

      Returns:
      The access key ID that identifies the temporary security credentials.
    • withAccessKeyId

      public Credentials withAccessKeyId(String accessKeyId)

      The access key ID that identifies the temporary security credentials.

      Parameters:
      accessKeyId - The access key ID that identifies the temporary security credentials.
      Returns:
      Returns a reference to this object so that method calls can be chained together.
    • setSecretAccessKey

      public void setSecretAccessKey(String secretAccessKey)

      The secret access key that can be used to sign requests.

      Parameters:
      secretAccessKey - The secret access key that can be used to sign requests.
    • getSecretAccessKey

      public String getSecretAccessKey()

      The secret access key that can be used to sign requests.

      Returns:
      The secret access key that can be used to sign requests.
    • withSecretAccessKey

      public Credentials withSecretAccessKey(String secretAccessKey)

      The secret access key that can be used to sign requests.

      Parameters:
      secretAccessKey - The secret access key that can be used to sign requests.
      Returns:
      Returns a reference to this object so that method calls can be chained together.
    • setSessionToken

      public void setSessionToken(String sessionToken)

      The token that users must pass to the service API to use the temporary credentials.

      Parameters:
      sessionToken - The token that users must pass to the service API to use the temporary credentials.
    • getSessionToken

      public String getSessionToken()

      The token that users must pass to the service API to use the temporary credentials.

      Returns:
      The token that users must pass to the service API to use the temporary credentials.
    • withSessionToken

      public Credentials withSessionToken(String sessionToken)

      The token that users must pass to the service API to use the temporary credentials.

      Parameters:
      sessionToken - The token that users must pass to the service API to use the temporary credentials.
      Returns:
      Returns a reference to this object so that method calls can be chained together.
    • setExpiration

      public void setExpiration(Date expiration)

      The date on which the current credentials expire.

      Parameters:
      expiration - The date on which the current credentials expire.
    • getExpiration

      public Date getExpiration()

      The date on which the current credentials expire.

      Returns:
      The date on which the current credentials expire.
    • withExpiration

      public Credentials withExpiration(Date expiration)

      The date on which the current credentials expire.

      Parameters:
      expiration - The date on which the current credentials expire.
      Returns:
      Returns a reference to this object so that method calls can be chained together.
    • toString

      public String toString()
      Returns a string representation of this object; useful for testing and debugging.
      Overrides:
      toString in class Object
      Returns:
      A string representation of this object.
      See Also:
    • equals

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

      public int hashCode()
      Overrides:
      hashCode in class Object
    • clone

      public Credentials clone()
      Overrides:
      clone in class Object