Class Credentials


  • public class Credentials
    extends java.lang.Object
    A class representing a set of AWS credentials.
    • Constructor Detail

      • Credentials

        public Credentials()
        Anonymous Credentials constructor. Use Anonymous Credentials when you want to skip signing. The recommended approach is to use createAnonymousCredentials().
      • Credentials

        public Credentials​(byte[] accessKeyId,
                           byte[] secretAccessKey,
                           byte[] sessionToken)
        Parameters:
        accessKeyId - - access key id to use
        secretAccessKey - - secret access key to use
        sessionToken - - (optional) session token to use
      • Credentials

        public Credentials​(byte[] accessKeyId,
                           byte[] secretAccessKey,
                           byte[] sessionToken,
                           long expirationTimePointSecs)
        Parameters:
        accessKeyId - - access key id to use
        secretAccessKey - - secret access key to use
        sessionToken - - (optional) session token to use
        expirationTimePointSecs - - Time when the credentials expires, as secs since epoch.
    • Method Detail

      • createAnonymousCredentials

        public static Credentials createAnonymousCredentials()
        Anonymous Credentials constructor. Use Anonymous Credentials when you want to skip signing.
        Returns:
        Anonymous Credentials
      • getAccessKeyId

        public byte[] getAccessKeyId()
        Returns:
        the access key id of the credentials
      • getSecretAccessKey

        public byte[] getSecretAccessKey()
        Returns:
        the secret access key of the credentials
      • getSessionToken

        public byte[] getSessionToken()
        Returns:
        the session token of the credentials
      • getExpirationTimePointSecs

        public long getExpirationTimePointSecs()
        Returns:
        the expiration timepoint as secs since epoch.