Package net.jsign.jca
Class AmazonCredentials
- java.lang.Object
-
- net.jsign.jca.AmazonCredentials
-
public class AmazonCredentials extends Object
AWS credentials- Since:
- 5.0
-
-
Constructor Summary
Constructors Constructor Description AmazonCredentials(String accessKey, String secretKey, String sessionToken)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description StringgetAccessKey()static AmazonCredentialsgetDefault()Returns the default AWS credentials, fetched from the following sources in order: The environment variables AWS_ACCESS_KEY_ID (or AWS_ACCESS_KEY), AWS_SECRET_KEY (or AWS_SECRET_ACCESS_KEY) and AWS_SESSION_TOKEN The EC2 instance metadata service (IMDSv2)StringgetSecretKey()StringgetSessionToken()static AmazonCredentialsparse(String credentials)Parses the concatenated AWS credentials
-
-
-
Constructor Detail
-
AmazonCredentials
public AmazonCredentials(String accessKey, String secretKey, String sessionToken)
-
-
Method Detail
-
getAccessKey
public String getAccessKey()
-
getSecretKey
public String getSecretKey()
-
getSessionToken
public String getSessionToken()
-
parse
public static AmazonCredentials parse(String credentials) throws IllegalArgumentException
Parses the concatenated AWS credentials- Parameters:
credentials- accessKey|secretKey|sessionToken (the session token is optional)- Throws:
IllegalArgumentException
-
getDefault
public static AmazonCredentials getDefault() throws IOException
Returns the default AWS credentials, fetched from the following sources in order:- The environment variables AWS_ACCESS_KEY_ID (or AWS_ACCESS_KEY), AWS_SECRET_KEY (or AWS_SECRET_ACCESS_KEY) and AWS_SESSION_TOKEN
- The EC2 instance metadata service (IMDSv2)
- Throws:
IOException
-
-