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:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor Description Credentials()
Default constructor for Credentials object.Credentials(String accessKeyId, String secretAccessKey, String sessionToken, Date expiration)
Constructs a new Credentials object.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Credentials
clone()
boolean
equals(Object obj)
String
getAccessKeyId()
The access key ID that identifies the temporary security credentials.Date
getExpiration()
The date on which the current credentials expire.String
getSecretAccessKey()
The secret access key that can be used to sign requests.String
getSessionToken()
The token that users must pass to the service API to use the temporary credentials.int
hashCode()
void
setAccessKeyId(String accessKeyId)
The access key ID that identifies the temporary security credentials.void
setExpiration(Date expiration)
The date on which the current credentials expire.void
setSecretAccessKey(String secretAccessKey)
The secret access key that can be used to sign requests.void
setSessionToken(String sessionToken)
The token that users must pass to the service API to use the temporary credentials.String
toString()
Returns a string representation of this object; useful for testing and debugging.Credentials
withAccessKeyId(String accessKeyId)
The access key ID that identifies the temporary security credentials.Credentials
withExpiration(Date expiration)
The date on which the current credentials expire.Credentials
withSecretAccessKey(String secretAccessKey)
The secret access key that can be used to sign requests.Credentials
withSessionToken(String sessionToken)
The token that users must pass to the service API to use the temporary credentials.
-
-
-
Constructor Detail
-
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 Detail
-
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 classObject
- Returns:
- A string representation of this object.
- See Also:
Object.toString()
-
clone
public Credentials clone()
-
-