Package org.jets3t.service.security

Examples of org.jets3t.service.security.EncryptionUtil


       
        // Sort upload file candidates by path.
        ArrayList sortedFilesKeys = new ArrayList(filesMap.keySet());
        Collections.sort(sortedFilesKeys);
       
        EncryptionUtil encryptionUtil = null;
        if (isEncryptionEnabled) {
            String algorithm = Jets3tProperties.getInstance(Constants.JETS3T_PROPERTIES_FILENAME)
                .getStringProperty("crypto.algorithm", "PBEWithMD5AndDES");
            encryptionUtil = new EncryptionUtil(cryptoPassword, algorithm, EncryptionUtil.DEFAULT_VERSION);
        }
       
        // Iterate through local files and perform the necessary action to synchronise them with S3.
        Iterator fileKeyIter = sortedFilesKeys.iterator();
        while (fileKeyIter.hasNext()) {
View Full Code Here


        else if ("PreferencesDialog".equals(event.getActionCommand())) {
            PreferencesDialog.showDialog(cockpitPreferences, ownerFrame, this);
           
            if (cockpitPreferences.isEncryptionPasswordSet()) {
                try {
                    encryptionUtil = new EncryptionUtil(
                        cockpitPreferences.getEncryptionPassword(),
                        cockpitPreferences.getEncryptionAlgorithm(),
                        EncryptionUtil.DEFAULT_VERSION);
                } catch (Exception e) {
                    String message = "Unable to start encryption utility";
View Full Code Here

            if (fileTarget.getParentFile() != null) {
                fileTarget.getParentFile().mkdirs();
            }           
           
            boolean isZipped = false;
            EncryptionUtil encryptionUtil = null;
                       
            if (automaticUnzip &&
                ("gzip".equalsIgnoreCase(object.getContentEncoding())
                || object.containsMetadata(Constants.METADATA_JETS3T_COMPRESSED)))
            {
                // Object data is gzipped.
                isZipped = true;
            }
            if (automaticDecrypt
                && (object.containsMetadata(Constants.METADATA_JETS3T_ENCRYPTED_OBSOLETE)
                    || object.containsMetadata(Constants.METADATA_JETS3T_CRYPTO_ALGORITHM)))
            {
                // Object is encrypted.
                if (encryptionPassword == null) {
                    throw new S3ServiceException(
                        "One or more objects are encrypted, and cannot be downloaded unless "
                        + " the encyption password is provided");
                }
               
                if (object.containsMetadata(Constants.METADATA_JETS3T_ENCRYPTED_OBSOLETE)) {
                    // Item is encrypted with obsolete crypto.
                    encryptionUtil = EncryptionUtil.getObsoleteEncryptionUtil(
                        encryptionPassword);                                           
                } else {
                    String algorithm = (String) object.getMetadata(
                        Constants.METADATA_JETS3T_CRYPTO_ALGORITHM);
                    String version = (String) object.getMetadata(
                        Constants.METADATA_JETS3T_CRYPTO_VERSION);
                    if (version == null) {
                        version = EncryptionUtil.DEFAULT_VERSION;
                    }
                    encryptionUtil = new EncryptionUtil(encryptionPassword, algorithm, version);                                           
                }                   
            }
           
            return new DownloadPackage(object, fileTarget, isZipped, encryptionUtil);
        }
View Full Code Here

    {
        if (Mimetypes.MIMETYPE_JETS3T_DIRECTORY.equals(object.getContentType())) {
            return null;
        } else {           
            boolean isZipped = false;
            EncryptionUtil encryptionUtil = null;
                       
            if (automaticUnzip &&
                ("gzip".equalsIgnoreCase(object.getContentEncoding())
                || object.containsMetadata(Constants.METADATA_JETS3T_COMPRESSED)))
            {
                // Object data is gzipped.
                isZipped = true;
            }
            if (automaticDecrypt
                && (object.containsMetadata(Constants.METADATA_JETS3T_ENCRYPTED_OBSOLETE)
                    || object.containsMetadata(Constants.METADATA_JETS3T_CRYPTO_ALGORITHM)))
            {
                // Object is encrypted.
                if (encryptionPassword == null) {
                    throw new S3ServiceException(
                        "One or more objects are encrypted, and cannot be downloaded unless "
                        + " the encyption password is provided");
                }
               
                if (object.containsMetadata(Constants.METADATA_JETS3T_ENCRYPTED_OBSOLETE)) {
                    // Item is encrypted with obsolete crypto.
                    encryptionUtil = EncryptionUtil.getObsoleteEncryptionUtil(
                        encryptionPassword);                                           
                } else {
                    String algorithm = (String) object.getMetadata(
                        Constants.METADATA_JETS3T_CRYPTO_ALGORITHM);
                    String version = (String) object.getMetadata(
                        Constants.METADATA_JETS3T_CRYPTO_VERSION);
                    if (version == null) {
                        version = EncryptionUtil.DEFAULT_VERSION;
                    }
                    encryptionUtil = new EncryptionUtil(encryptionPassword, algorithm, version);                                           
                }                   
            }
           
            return new DownloadPackage(object, fileTarget, isZipped, encryptionUtil);
        }
View Full Code Here

                cockpitPreferencesPropertiesFile.delete();
            }
           
            if (cockpitPreferences.isEncryptionPasswordSet()) {
                try {
                    encryptionUtil = new EncryptionUtil(
                        cockpitPreferences.getEncryptionPassword(),
                        cockpitPreferences.getEncryptionAlgorithm(),
                        EncryptionUtil.DEFAULT_VERSION);
                } catch (Exception e) {
                    String message = "Unable to start encryption utility";
View Full Code Here

        else if ("PreferencesDialog".equals(event.getActionCommand())) {
            PreferencesDialog.showDialog(cockpitPreferences, ownerFrame, this);
           
            if (cockpitPreferences.isEncryptionPasswordSet()) {
                try {
                    encryptionUtil = new EncryptionUtil(
                        cockpitPreferences.getEncryptionPassword(),
                        cockpitPreferences.getEncryptionAlgorithm(),
                        EncryptionUtil.DEFAULT_VERSION);
                } catch (Exception e) {
                    String message = "Unable to start encryption utility";
View Full Code Here

        FileComparerResults mergedDiscrepancyResults = new FileComparerResults();
        String priorLastKey = null;
        String lastFileKeypathChecked = "";
        long totalObjectsListed = 0;

        EncryptionUtil encryptionUtil = null;
        if (isEncryptionEnabled) {
            String algorithm = properties
                .getStringProperty("crypto.algorithm", "PBEWithMD5AndDES");
            encryptionUtil = new EncryptionUtil(cryptoPassword, algorithm, EncryptionUtil.DEFAULT_VERSION);
        }
       
        // Repeat upload actions until all objects in bucket have been listed.
        do {
            // List objects in S3. Listing may be complete, or partial.
View Full Code Here

    {
        if (Mimetypes.MIMETYPE_JETS3T_DIRECTORY.equals(object.getContentType())) {
            return null;
        } else {           
            boolean isZipped = false;
            EncryptionUtil encryptionUtil = null;
                       
            if (automaticUnzip &&
                ("gzip".equalsIgnoreCase(object.getContentEncoding())
                || object.containsMetadata(Constants.METADATA_JETS3T_COMPRESSED)))
            {
                // Object data is gzipped.
                isZipped = true;
            }
            if (automaticDecrypt
                && (object.containsMetadata(Constants.METADATA_JETS3T_ENCRYPTED_OBSOLETE)
                    || object.containsMetadata(Constants.METADATA_JETS3T_CRYPTO_ALGORITHM)))
            {
                // Object is encrypted.
                if (encryptionPassword == null) {
                    throw new S3ServiceException(
                        "One or more objects are encrypted, and cannot be downloaded unless "
                        + " the encyption password is provided");
                }
               
                if (object.containsMetadata(Constants.METADATA_JETS3T_ENCRYPTED_OBSOLETE)) {
                    // Item is encrypted with obsolete crypto.
                    encryptionUtil = EncryptionUtil.getObsoleteEncryptionUtil(
                        encryptionPassword);                                           
                } else {
                    String algorithm = (String) object.getMetadata(
                        Constants.METADATA_JETS3T_CRYPTO_ALGORITHM);
                    String version = (String) object.getMetadata(
                        Constants.METADATA_JETS3T_CRYPTO_VERSION);
                    if (version == null) {
                        version = EncryptionUtil.DEFAULT_VERSION;
                    }
                    encryptionUtil = new EncryptionUtil(encryptionPassword, algorithm, version);                                           
                }                   
            }
           
            return new DownloadPackage(object, fileTarget, isZipped, encryptionUtil);
        }
View Full Code Here

        FileComparerResults mergedDiscrepancyResults = new FileComparerResults();
        String priorLastKey = null;
        String lastFileKeypathChecked = "";
        long totalObjectsListed = 0;

        EncryptionUtil encryptionUtil = null;
        if (isEncryptionEnabled) {
            String algorithm = properties
                .getStringProperty("crypto.algorithm", "PBEWithMD5AndDES");
            encryptionUtil = new EncryptionUtil(cryptoPassword, algorithm, EncryptionUtil.DEFAULT_VERSION);
        }
       
        // Repeat upload actions until all objects in bucket have been listed.
        do {
            // List objects in S3. Listing may be complete, or partial.
View Full Code Here

        if (object.isDirectoryPlaceholder()) {
            return null;
        }
        else {
            boolean isZipped = false;
            EncryptionUtil encryptionUtil = null;

            if (automaticUnzip &&
                ("gzip".equalsIgnoreCase(object.getContentEncoding())
                || object.containsMetadata(Constants.METADATA_JETS3T_COMPRESSED)))
            {
                // Object data is gzipped.
                isZipped = true;
            }
            if (automaticDecrypt
                && object.containsMetadata(Constants.METADATA_JETS3T_CRYPTO_ALGORITHM))
            {
                // Object is encrypted.
                if (encryptionPassword == null) {
                    throw new ServiceException(
                        "One or more objects are encrypted, and cannot be downloaded unless "
                        + " the encyption password is provided");
                }

                String algorithm = (String) object.getMetadata(
                    Constants.METADATA_JETS3T_CRYPTO_ALGORITHM);
                String version = (String) object.getMetadata(
                    Constants.METADATA_JETS3T_CRYPTO_VERSION);
                if (version == null) {
                    version = EncryptionUtil.DEFAULT_VERSION;
                }
                encryptionUtil = new EncryptionUtil(encryptionPassword, algorithm, version);
            }

            return new DownloadPackage(object, fileTarget, isZipped, encryptionUtil);
        }
    }
View Full Code Here

TOP

Related Classes of org.jets3t.service.security.EncryptionUtil

Copyright © 2018 www.massapicom. 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.