Package org.apache.geronimo.management.geronimo

Examples of org.apache.geronimo.management.geronimo.KeystoreException


                } else if(keystore.isCertificateEntry(alias)) {
                    trustCerts.add(alias);
                }
            }
        } catch (KeyStoreException e) {
            throw new KeystoreException("Unable to open keystore with provided password", e);
        } catch (IOException e) {
            throw new KeystoreException("Unable to open keystore with provided password", e);
        } catch (NoSuchAlgorithmException e) {
            throw new KeystoreException("Unable to open keystore with provided password", e);
        } catch (CertificateException e) {
            throw new KeystoreException("Unable to open keystore with provided password", e);
        } finally {
            if(in != null) {
                try {
                    in.close();
                } catch (IOException e) {
View Full Code Here


            keystore.store(out, password);
            out.flush();
            out.close();
            keystoreReadDate = System.currentTimeMillis();
        } catch (KeyStoreException e) {
            throw new KeystoreException("Unable to save keystore '" + keystoreName + "'", e);
        } catch (FileNotFoundException e) {
            throw new KeystoreException("Unable to save keystore '" + keystoreName + "'", e);
        } catch (IOException e) {
            throw new KeystoreException("Unable to save keystore '" + keystoreName + "'", e);
        } catch (NoSuchAlgorithmException e) {
            throw new KeystoreException("Unable to save keystore '" + keystoreName + "'", e);
        } catch (CertificateException e) {
            throw new KeystoreException("Unable to save keystore '" + keystoreName + "'", e);
        }
    }
View Full Code Here

            cls.getMethod("init", new Class[]{kmc, tmc, src}).invoke(ctx, new Object[]{keyInstance.getKeyManager(algorithm, keyAlias, null),
                                                                            trustInstance == null ? null : trustInstance.getTrustManager(algorithm, null),
                                                                            new java.security.SecureRandom()});
            return (SSLContext) ctx;
        } catch (Exception e) {
            throw new KeystoreException("Unable to create SSL Context", e);
        }
    }
View Full Code Here

            keystore.store(out, password);
            out.flush();
            out.close();
            return getKeystore(name, keystoreType);
        } catch (KeyStoreException e) {
            throw new KeystoreException("Unable to create keystore", e);
        } catch (IOException e) {
            throw new KeystoreException("Unable to create keystore", e);
        } catch (NoSuchAlgorithmException e) {
            throw new KeystoreException("Unable to create keystore", e);
        } catch (CertificateException e) {
            throw new KeystoreException("Unable to create keystore", e);
        }
    }
View Full Code Here

        }
        ensureLoaded(password);
        try {
            kernel.setAttribute(abstractName, "keystorePassword", new String(password));
        } catch (Exception e) {
            throw new KeystoreException("Unable to set attribute keystorePassword on myself!", e);
        }
    }
View Full Code Here

        try {
            kernel.setAttribute(abstractName, "keystorePassword", null);
            keyPasswords.clear();
            storePasswords();
        } catch (Exception e) {
            throw new KeystoreException("Unable to set attribute keystorePassword on myself!", e);
        }
    }
View Full Code Here

        return (String[]) privateKeys.toArray(new String[privateKeys.size()]);
    }

    public void unlockPrivateKey(String alias, char[] storePassword, char[] password) throws KeystoreException {
        if (storePassword == null && keystorePassword == null) {
            throw new KeystoreException("storePassword is null and keystore is locked for availability.");
        }
        if(storePassword != null)
            getPrivateKey(alias, storePassword, password);
        else
            getPrivateKey(alias, keystorePassword, password);
View Full Code Here

            buf.append(entry.getKey()).append("=").append((char[])entry.getValue());
        }
        try {
            kernel.setAttribute(abstractName, "keyPasswords", buf.length() == 0 ? null : buf.toString());
        } catch (Exception e) {
            throw new KeystoreException("Unable to save key passwords in keystore '"+keystoreName+"'", e);
        }
    }
View Full Code Here

        }
        ensureLoaded(storePassword);
        try {
            keystore.setCertificateEntry(alias, cert);
        } catch (KeyStoreException e) {
            throw new KeystoreException("Unable to set certificate entry in keystore '" + keystoreName + "' for alias '" + alias + "'", e);
        }
        trustCerts.add(alias);
        saveKeystore(storePassword);
    }
View Full Code Here

                    validity, commonName, orgUnit, organization, locality, state, country);
   
            keystore.setKeyEntry(alias, keyPair.getPrivate(), keyPassword, new Certificate[] { cert });
            privateKeys.add(alias);
        } catch (KeyStoreException e) {
            throw new KeystoreException("Unable to generate key pair in keystore '" + keystoreName + "'", e);
        } catch (InvalidKeyException e) {
            throw new KeystoreException("Unable to generate key pair in keystore '" + keystoreName + "'", e);
        } catch (SignatureException e) {
            throw new KeystoreException("Unable to generate key pair in keystore '" + keystoreName + "'", e);
        } catch (NoSuchAlgorithmException e) {
            throw new KeystoreException("Unable to generate key pair in keystore '" + keystoreName + "'", e);
        }
        saveKeystore(storePassword);
    }
View Full Code Here

TOP

Related Classes of org.apache.geronimo.management.geronimo.KeystoreException

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.