Package org.apache.synapse.securevault

Examples of org.apache.synapse.securevault.SecureVaultException


        return null;
    }

    private void handleException(String msg, Exception e) {
        log.error(msg, e);
        throw new SecureVaultException(msg, e);
    }
View Full Code Here


     * @param keyPassword Specifies the password of the key within the keyStore
     */
    protected void init(KeyStoreInformation information, String keyPassword) {

        if (information == null) {
            throw new SecureVaultException("KeyStore information cannot be found", log);
        }
        this.keyStoreInformation = information;
        this.keyPassword = keyPassword;

        if (information instanceof TrustKeyStoreInformation) {
            this.keyStore = ((TrustKeyStoreInformation) information).getTrustStore();
        } else if (information instanceof IdentityKeyStoreInformation) {
            this.keyStore = ((IdentityKeyStoreInformation) information).getIdentityKeyStore();
        } else {
            throw new SecureVaultException("Invalid KeyStore type", log);
        }
    }
View Full Code Here

     * @return Key if there is a one , otherwise null
     */
    protected Key getKey(String alias, String keyPassword) {

        if (alias == null || "".equals(alias)) {
            throw new SecureVaultException("The alias need to provided to get certificate", log);
        }
        if (keyPassword != null) {
            try {
                return keyStore.getKey(alias, keyPassword.toCharArray());
            } catch (KeyStoreException e) {
                throw new SecureVaultException("Error loading key for alias : " + alias, e, log);
            } catch (NoSuchAlgorithmException e) {
                throw new SecureVaultException("Error loading key for alias : " + alias, e, log);
            } catch (UnrecoverableKeyException e) {
                throw new SecureVaultException("Error loading key for alias : " + alias, e, log);
            }
        }
        return null;
    }
View Full Code Here

            Certificate certificate = keyStore.getCertificate(alias);
            if (certificate != null) {
                return certificate.getPublicKey();
            }
        } catch (KeyStoreException e) {
            throw new SecureVaultException("Error loading key for alias : " + alias, e, log);
        }
        return null;
    }
View Full Code Here

        return null;
    }

    private void handleException(String msg, Exception e) {
        log.error(msg, e);
        throw new SecureVaultException(msg, e);
    }
View Full Code Here

        return null;
    }

    protected void handleException(String msg, Exception e) {
        log.error(msg, e);
        throw new SecureVaultException(msg, e);
    }
View Full Code Here

        throw new SecureVaultException(msg, e);
    }

    protected void handleException(String msg) {
        log.error(msg);
        throw new SecureVaultException(msg);
    }
View Full Code Here

            try {
                properties.load(in);
            } catch (IOException e) {
                String msg = "Error loading properties from a file at :" + filePath;
                log.error(msg, e);
                throw new SecureVaultException(msg, e);
            }
        }
        return properties;
    }
View Full Code Here

        int len;
        try {
            while ((len = in.read(buffer)) >= 0)
                out.write(buffer, 0, len);
        } catch (IOException e) {
            throw new SecureVaultException("Error during converting a inputstream " +
                    "into a bytearray ", e, log);
        } finally {
            if (in != null) {
                try {
                    in.close();
View Full Code Here

     *
     * @param msg The error message
     */
    private static void handleException(String msg) {
        log.error(msg);
        throw new SecureVaultException(msg);
    }
View Full Code Here

TOP

Related Classes of org.apache.synapse.securevault.SecureVaultException

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.