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 Credentialsclone()booleanequals(Object obj)StringgetAccessKeyId()The access key ID that identifies the temporary security credentials.DategetExpiration()The date on which the current credentials expire.StringgetSecretAccessKey()The secret access key that can be used to sign requests.StringgetSessionToken()The token that users must pass to the service API to use the temporary credentials.inthashCode()voidsetAccessKeyId(String accessKeyId)The access key ID that identifies the temporary security credentials.voidsetExpiration(Date expiration)The date on which the current credentials expire.voidsetSecretAccessKey(String secretAccessKey)The secret access key that can be used to sign requests.voidsetSessionToken(String sessionToken)The token that users must pass to the service API to use the temporary credentials.StringtoString()Returns a string representation of this object; useful for testing and debugging.CredentialswithAccessKeyId(String accessKeyId)The access key ID that identifies the temporary security credentials.CredentialswithExpiration(Date expiration)The date on which the current credentials expire.CredentialswithSecretAccessKey(String secretAccessKey)The secret access key that can be used to sign requests.CredentialswithSessionToken(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:
toStringin classObject- Returns:
- A string representation of this object.
- See Also:
Object.toString()
-
clone
public Credentials clone()
-
-