Package org.apache.geronimo.management.geronimo

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


                                                                            trustInstance == null ? null : trustInstance.getTrustManager(algorithm, null),
                                                                            new java.security.SecureRandom()});
            Object result = cls.getMethod("getServerSocketFactory", new Class[0]).invoke(ctx, new Object[0]);
            return (SSLServerSocketFactory) result;
        } catch (Exception e) {
            throw new KeystoreException("Unable to create SSL Server Factory", e);
        }
    }
View Full Code Here


            keystore.store(out, password);
            out.flush();
            out.close();
            return getKeystore(name);
        } 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

                                                                            trustInstance == null ? null : trustInstance.getTrustManager(algorithm, null),
                                                                            new java.security.SecureRandom()});
            Object result = cls.getMethod("getSocketFactory", new Class[0]).invoke(ctx, new Object[0]);
            return (SSLSocketFactory) result;
        } catch (Exception e) {
            throw new KeystoreException("Unable to create SSL Factory", e);
        }
    }
View Full Code Here

        // OMG this hurts, but it causes ClassCastExceptions elsewhere unless done this way!
        try {
            Object result = sslContext.getClass().getMethod("getServerSocketFactory", new Class[0]).invoke(sslContext, new Object[0]);
            return (SSLServerSocketFactory) result;
        } catch (Exception e) {
            throw new KeystoreException("Unable to create SSL Server Factory", 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.