org.jets3t.service.security
Class AWSCredentials

java.lang.Object
  extended by org.jets3t.service.security.ProviderCredentials
      extended by org.jets3t.service.security.AWSCredentials
Direct Known Subclasses:
AWSDevPayCredentials

public class AWSCredentials
extends ProviderCredentials

Class to contain the Amazon Web Services (AWS) credentials of a user. This class also includes utility methods to store credentials to password-encrypted files, and retrieve credentials from these files.


Field Summary
 
Fields inherited from class org.jets3t.service.security.ProviderCredentials
accessKey, CREDENTIALS_STORAGE_VERSION, friendlyName, log, secretKey, V2_KEYS_DELIMITER, V3_KEYS_DELIMITER
 
Constructor Summary
AWSCredentials(java.lang.String awsAccessKey, java.lang.String awsSecretAccessKey)
          Construct credentials.
AWSCredentials(java.lang.String awsAccessKey, java.lang.String awsSecretAccessKey, java.lang.String friendlyName)
          Construct credentials, and associate them with a human-friendly name.
 
Method Summary
protected  java.lang.String getTypeName()
           
 java.lang.String getVersionPrefix()
           
static void main(java.lang.String[] args)
          Console utility to store AWS credentials information in an encrypted file in the toolkit's default preferences directory.
 
Methods inherited from class org.jets3t.service.security.ProviderCredentials
getAccessKey, getDataToEncrypt, getFriendlyName, getLogString, getSecretKey, hasFriendlyName, load, load, save, save, save, save
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AWSCredentials

public AWSCredentials(java.lang.String awsAccessKey,
                      java.lang.String awsSecretAccessKey)
Construct credentials.

Parameters:
awsAccessKey - AWS access key for an Amazon S3 account.
awsSecretAccessKey - AWS secret key for an Amazon S3 account.

AWSCredentials

public AWSCredentials(java.lang.String awsAccessKey,
                      java.lang.String awsSecretAccessKey,
                      java.lang.String friendlyName)
Construct credentials, and associate them with a human-friendly name.

Parameters:
awsAccessKey - AWS access key for an Amazon S3 account.
awsSecretAccessKey - AWS secret key for an Amazon S3 account.
friendlyName - a name identifying the owner of the credentials, such as 'James'.
Method Detail

getTypeName

protected java.lang.String getTypeName()
Specified by:
getTypeName in class ProviderCredentials
Returns:
string representing this credential type's name (for serialization)

getVersionPrefix

public java.lang.String getVersionPrefix()
Specified by:
getVersionPrefix in class ProviderCredentials

main

public static void main(java.lang.String[] args)
                 throws java.lang.Exception
Console utility to store AWS credentials information in an encrypted file in the toolkit's default preferences directory.

This class can be run from the command line as:

 java org.jets3t.service.security.AWSCredentials <friendlyName> <credentialsFilename> <algorithm>
 
When run it will prompt for the user's AWS access key,secret key and encryption password. It will then encode into the specified credentials file.

Parameters:
args -
Throws:
java.lang.Exception