Package org.jets3t.service.security

Examples of org.jets3t.service.security.AWSCredentials.save()


        // Initialise an S3 Service that knows the AWS credentials.
        S3Service s3Service = new RestS3Service(awsCredentials);
       
        // Encrypt credentials into InputStream
        ByteArrayOutputStream baos = new ByteArrayOutputStream();
        awsCredentials.save(password, baos);
        ByteArrayInputStream bais = new ByteArrayInputStream(baos.toByteArray());
       
        // Create the target bucket
        bucket = s3Service.createBucket(bucketName);
View Full Code Here


        // The AWSCredentials class provides utility methods to allow credentials to be saved to
        // an encrypted file and loaded from a previously saved file with the right password.
       
        // Save credentials to an encrypted file protected with a password.
        File credFile = new File("awscredentials.enc");
        awsCredentials.save("password", credFile);
       
        // Load encrypted credentials from a file.
        AWSCredentials loadedCredentials = AWSCredentials.load("password", credFile);
        System.out.println("AWS Key loaded from file: " + loadedCredentials.getAccessKey());
       
View Full Code Here

        final ByteArrayInputStream[] bais = new ByteArrayInputStream[1];
        try {
            // Convert AWS Credentials into a readable input stream.
            ByteArrayOutputStream baos = new ByteArrayOutputStream();
            awsCredentials.save(password, baos);
            bais[0] = new ByteArrayInputStream(baos.toByteArray());
        } catch (RuntimeException e) {
            throw e;
        } catch (Exception e) {
            String message = "Unable to encrypt your AWS Credentials";
View Full Code Here

        }
       
        File credentialsFile = new File(directory, awsCredentials.getFriendlyName() + ".enc");
       
        try {
            awsCredentials.save(password, credentialsFile);
            loginLocalFolderPanel.refreshStoredCredentialsTable();
   
            JOptionPane.showMessageDialog(ownerFrame, "Your AWS Credentials have been stored in the file:\n" +
                credentialsFile.getAbsolutePath());
            actionModeComboBox.setSelectedIndex(ACTION_MODE_LOG_IN);
View Full Code Here

        final ByteArrayInputStream[] bais = new ByteArrayInputStream[1];
        try {
            // Convert AWS Credentials into a readable input stream.
            String algorithm = myProperties.getStringProperty("crypto.algorithm", "PBEWithMD5AndDES");           
            ByteArrayOutputStream baos = new ByteArrayOutputStream();
            awsCredentials.save(password, baos, algorithm);
            bais[0] = new ByteArrayInputStream(baos.toByteArray());
        } catch (RuntimeException e) {
            throw e;
        } catch (Exception e) {
            String message = "Unable to encrypt your AWS Credentials";
View Full Code Here

       
        File credentialsFile = new File(directory, awsCredentials.getFriendlyName() + ".enc");
       
        try {
            String algorithm = myProperties.getStringProperty("crypto.algorithm", "PBEWithMD5AndDES");           
            awsCredentials.save(password, credentialsFile, algorithm);
            loginLocalFolderPanel.clearPassword();
            loginLocalFolderPanel.refreshStoredCredentialsTable();
           
            JOptionPane.showMessageDialog(ownerFrame, "Your AWS Credentials have been stored in the file:\n" +
                credentialsFile.getAbsolutePath());
View Full Code Here

        // The AWSCredentials class provides utility methods to allow credentials to be saved to
        // an encrypted file and loaded from a previously saved file with the right password.
       
        // Save credentials to an encrypted file protected with a password.
        File credFile = new File("awscredentials.enc");
        awsCredentials.save("password", credFile);
       
        // Load encrypted credentials from a file.
        AWSCredentials loadedCredentials = AWSCredentials.load("password", credFile);
        System.out.println("AWS Key loaded from file: " + loadedCredentials.getAccessKey());
       
View Full Code Here

        // The AWSCredentials class provides utility methods to allow credentials to be saved to
        // an encrypted file and loaded from a previously saved file with the right password.
       
        // Save credentials to an encrypted file protected with a password.
        File credFile = new File("awscredentials.enc");
        awsCredentials.save("password", credFile);
       
        // Load encrypted credentials from a file.
        AWSCredentials loadedCredentials = AWSCredentials.load("password", credFile);
        System.out.println("AWS Key loaded from file: " + loadedCredentials.getAccessKey());
       
View Full Code Here

                            "Content-Type: application/octet-stream\r\n" +
                            "Content-Length: 139\r\n" +
                            "Server: AmazonS3\r\n\r\n";
                       
                        out.write(headers.getBytes("UTF-8"));
                        fakeAwsCredentials.save("please", out);
                    }
                   
                    else if (path.equals("/")) {
                        // Return fake bucket listing.
                        String headers =
View Full Code Here

        // Initialise an S3 Service that knows the AWS credentials.
        S3Service s3Service = new RestS3Service(awsCredentials);

        // Encrypt credentials into InputStream
        ByteArrayOutputStream baos = new ByteArrayOutputStream();
        awsCredentials.save(password, baos);
        ByteArrayInputStream bais = new ByteArrayInputStream(baos.toByteArray());

        // Create the target bucket
        bucket = s3Service.createBucket(bucketName);
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.