Examples of CipherInformation


Examples of org.apache.synapse.securevault.definition.CipherInformation

        // parse the command line arguments
        try {
            CommandLine cmd = parser.parse(options, args);

            // Loads the cipher relate information
            CipherInformation cipherInformation = getCipherInformation(cmd);

            // Source  as an in-lined
            String source = getArgument(cmd, SOURCE_IN_LINED, null);
            assertEmpty(source, SOURCE_IN_LINED);

            Key key = findKey(cmd, cipherInformation);

            boolean isEncrypt = (cipherInformation.getCipherOperationMode() ==
                    CipherOperationMode.ENCRYPT);

            EncryptionProvider encryptionProvider = null;
            DecryptionProvider decryptionProvider = null;
View Full Code Here

Examples of org.apache.synapse.securevault.definition.CipherInformation

     * @param cmd Command line which capture all command line arguments
     * @return CipherInformation object
     */
    private static CipherInformation getCipherInformation(CommandLine cmd) {

        CipherInformation information = new CipherInformation();

        information.setAlgorithm(getArgument(cmd, ALGORITHM, CipherInformation.DEFAULT_ALGORITHM));

        information.setCipherOperationMode(CipherOperationMode.valueOf(
                getArgument(cmd, OP_MODE, CipherOperationMode.ENCRYPT.toString()).toUpperCase()));

        String encInType = getArgument(cmd, IN_TYPE, null);
        if (encInType != null) {
            information.setInType(EncodingType.valueOf(encInType.toUpperCase()));
        }

        String encOutType = getArgument(cmd, OUT_TYPE, null);
        if (encOutType != null) {
            information.setOutType(EncodingType.valueOf(encOutType.toUpperCase()));
        }

        information.setType(getArgument(cmd, CIPHER_TYPE, null));

        return information;
    }
View Full Code Here

Examples of org.apache.synapse.securevault.definition.CipherInformation

            keyStoreWrapper = identity;
        }

        //Creates a cipherInformation

        CipherInformation cipherInformation = new CipherInformation();
        cipherInformation.setAlgorithm(algorithm);
        cipherInformation.setCipherOperationMode(CipherOperationMode.DECRYPT);
        cipherInformation.setInType(EncodingType.BASE64); //TODO
        DecryptionProvider baseCipher =
                CipherFactory.createCipher(cipherInformation, keyStoreWrapper);

        for (Object alias : cipherProperties.keySet()) {
            //decrypt the encrypted text
View Full Code Here

Examples of org.apache.synapse.securevault.definition.CipherInformation

     *
     * @param encryptedSecret the encrypted secret
     * @return the decrypted secret.
     */
    private static String decrypt(String encryptedSecret) {
        CipherInformation cipherInformation = new CipherInformation();
        cipherInformation.setAlgorithm(ALGORITHM);
        cipherInformation.setCipherOperationMode(CipherOperationMode.DECRYPT);
        cipherInformation.setInType(EncodingType.BIGINTEGER16); //TODO
        DecryptionProvider decryptionProvider = CipherFactory.createCipher(cipherInformation, key);
        return new String(decryptionProvider.decrypt(encryptedSecret.getBytes()));
    }
View Full Code Here

Examples of org.apache.synapse.securevault.definition.CipherInformation

            keyStoreWrapper = identity;
        }

        //Creates a cipherInformation

        CipherInformation cipherInformation = new CipherInformation();
        cipherInformation.setAlgorithm(algorithm);
        cipherInformation.setCipherOperationMode(CipherOperationMode.DECRYPT);
        cipherInformation.setInType(EncodingType.BASE64); //TODO
        DecryptionProvider baseCipher =
                CipherFactory.createCipher(cipherInformation, keyStoreWrapper);

        for (Object alias : cipherProperties.keySet()) {
            //decrypt the encrypted text
View Full Code Here

Examples of org.apache.synapse.securevault.definition.CipherInformation

     *
     * @param encryptedSecret the encrypted secret
     * @return the decrypted secret.
     */
    private static String decrypt(String encryptedSecret) {
        CipherInformation cipherInformation = new CipherInformation();
        cipherInformation.setAlgorithm(ALGORITHM);
        cipherInformation.setCipherOperationMode(CipherOperationMode.DECRYPT);
        cipherInformation.setInType(EncodingType.BIGINTEGER16); //TODO
        DecryptionProvider decryptionProvider = CipherFactory.createCipher(cipherInformation, key);
        return new String(decryptionProvider.decrypt(encryptedSecret.getBytes()));
    }
View Full Code Here

Examples of org.wso2.securevault.definition.CipherInformation

            keyStoreWrapper = identity;
        }

        //Creates a cipherInformation

        CipherInformation cipherInformation = new CipherInformation();
        cipherInformation.setAlgorithm(algorithm);
        cipherInformation.setCipherOperationMode(CipherOperationMode.DECRYPT);
        cipherInformation.setInType(EncodingType.BASE64); //TODO
        DecryptionProvider baseCipher =
                CipherFactory.createCipher(cipherInformation, keyStoreWrapper);

        for (Object alias : cipherProperties.keySet()) {
            //decrypt the encrypted text
View Full Code Here

Examples of org.wso2.securevault.definition.CipherInformation

        // parse the command line arguments
        try {
            CommandLine cmd = parser.parse(options, args);

            // Loads the cipher relate information
            CipherInformation cipherInformation = getCipherInformation(cmd);

            // Source  as an in-lined
            String source = getArgument(cmd, SOURCE_IN_LINED, null);
            assertEmpty(source, SOURCE_IN_LINED);

            Key key = findKey(cmd, cipherInformation);

            boolean isEncrypt = (cipherInformation.getCipherOperationMode() ==
                    CipherOperationMode.ENCRYPT);

            EncryptionProvider encryptionProvider = null;
            DecryptionProvider decryptionProvider = null;
View Full Code Here

Examples of org.wso2.securevault.definition.CipherInformation

     * @param cmd Command line which capture all command line arguments
     * @return CipherInformation object
     */
    private static CipherInformation getCipherInformation(CommandLine cmd) {

        CipherInformation information = new CipherInformation();

        information.setAlgorithm(getArgument(cmd, ALGORITHM, CipherInformation.DEFAULT_ALGORITHM));

        information.setCipherOperationMode(CipherOperationMode.valueOf(
                getArgument(cmd, OP_MODE, CipherOperationMode.ENCRYPT.toString()).toUpperCase()));

        String encInType = getArgument(cmd, IN_TYPE, null);
        if (encInType != null) {
            information.setInType(EncodingType.valueOf(encInType.toUpperCase()));
        }

        String encOutType = getArgument(cmd, OUT_TYPE, null);
        if (encOutType != null) {
            information.setOutType(EncodingType.valueOf(encOutType.toUpperCase()));
        }

        information.setType(getArgument(cmd, CIPHER_TYPE, null));

        return information;
    }
View Full Code Here

Examples of org.wso2.securevault.definition.CipherInformation

     *
     * @param encryptedSecret the encrypted secret
     * @return the decrypted secret.
     */
    private static String decrypt(String encryptedSecret) {
        CipherInformation cipherInformation = new CipherInformation();
        cipherInformation.setAlgorithm(ALGORITHM);
        cipherInformation.setCipherOperationMode(CipherOperationMode.DECRYPT);
        cipherInformation.setInType(EncodingType.BIGINTEGER16); //TODO
        DecryptionProvider decryptionProvider = CipherFactory.createCipher(cipherInformation, key);
        return new String(decryptionProvider.decrypt(encryptedSecret.getBytes()));
    }
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.