Examples of KeystoreException


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

                    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

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

            PrivateKey key = (PrivateKey) keystore.getKey(alias, (char[])keyPasswords.get(alias));
            // generate csr
            String csr = generateCSR(cert, key);
            return csr;
        } catch (KeyStoreException e) {
            throw new KeystoreException("Unable to generate CSR in keystore '" + keystoreName + "' for alias '" + alias + "'", e);
        } catch (NoSuchAlgorithmException e) {
            throw new KeystoreException("Unable to generate CSR in keystore '" + keystoreName + "' for alias '" + alias + "'", e);
        } catch (UnrecoverableKeyException e) {
            throw new KeystoreException("Unable to generate CSR in keystore '" + keystoreName + "' for alias '" + alias + "'", e);
        } catch (InvalidKeyException e) {
            throw new KeystoreException("Unable to generate CSR in keystore '" + keystoreName + "' for alias '" + alias + "'", e);
        } catch (NoSuchProviderException e) {
            throw new KeystoreException("Unable to generate CSR in keystore '" + keystoreName + "' for alias '" + alias + "'", e);
        } catch (SignatureException e) {
            throw new KeystoreException("Unable to generate CSR in keystore '" + keystoreName + "' for alias '" + alias + "'", e);
        } catch (IOException e) {
            throw new KeystoreException("Unable to generate CSR in keystore '" + keystoreName + "' for alias '" + alias + "'", e);
        }
    }
View Full Code Here

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

                saveKeystore(keystorePassword);
            } else {
                log.error("Error in importPKCS7Certificate.  PublicKey in the certificate received is not related to the PrivateKey in the keystore. keystore = "+keystoreName+", alias = "+alias);
            }
        } catch (CertificateException e) {
            throw new KeystoreException("Unable to import PKCS7 certificat in keystore '" + keystoreName + "' for alias '" + alias + "'", e);
        } catch (KeyStoreException e) {
            throw new KeystoreException("Unable to import PKCS7 certificat in keystore '" + keystoreName + "' for alias '" + alias + "'", e);
        } catch (NoSuchAlgorithmException e) {
            throw new KeystoreException("Unable to import PKCS7 certificat in keystore '" + keystoreName + "' for alias '" + alias + "'", e);
        } catch (UnrecoverableKeyException e) {
            throw new KeystoreException("Unable to import PKCS7 certificat in keystore '" + keystoreName + "' for alias '" + alias + "'", e);
        } finally {
            if (is != null) {
                try {
                    is.close();
                } catch (Exception e) {
View Full Code Here

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

        }
        ensureLoaded(storePassword);
        try {
            keystore.deleteEntry(alias);
        } catch (KeyStoreException e) {
            throw new KeystoreException("Unable to delete key in keystore '" + keystoreName + "' for alias '" + alias + "'", e);
        }
        privateKeys.remove(alias);
        trustCerts.remove(alias);
        if (keyPasswords.containsKey(alias)) {
            keyPasswords.remove(alias);
View Full Code Here

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

                                        (char[]) keyPasswords.get(alias), keystore.getCertificateChain(alias));
                keyFactory.init(subKeystore, (char[]) keyPasswords.get(alias));
            }
            return keyFactory.getKeyManagers();
        } catch (KeyStoreException e) {
            throw new KeystoreException("Unable to retrieve key manager in keystore '" + keystoreName + "' for alias '" + alias + "'", e);
        } catch (NoSuchAlgorithmException e) {
            throw new KeystoreException("Unable to retrieve key manager in keystore '" + keystoreName + "' for alias '" + alias + "'", e);
        } catch (UnrecoverableKeyException e) {
            throw new KeystoreException("Unable to retrieve key manager in keystore '" + keystoreName + "' for alias '" + alias + "'", e);
        }
    }
View Full Code Here

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

        try {
            TrustManagerFactory trustFactory = TrustManagerFactory.getInstance(algorithm);
            trustFactory.init(keystore);
            return trustFactory.getTrustManagers();
        } catch (KeyStoreException e) {
            throw new KeystoreException("Unable to retrieve trust manager in keystore '" + keystoreName + "'", e);
        } catch (NoSuchAlgorithmException e) {
            throw new KeystoreException("Unable to retrieve trust manager in keystore '" + keystoreName + "'", e);
        }
    }
View Full Code Here

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

            if (key == null) {
                throw new KeyNotFoundException("Keystore '"+keystoreName+"' does not contain a private key with alias'"+alias+"'.");
            }
            return key;
        } catch (KeyStoreException e) {
            throw new KeystoreException("Unable to retrieve private key from keystore", e);
        } catch (NoSuchAlgorithmException e) {
            throw new KeystoreException("Unable to retrieve private key from keystore", e);
        } catch (UnrecoverableKeyException e) {
            throw new KeystoreException("Unable to retrieve private key from keystore", e);
        }
    }
View Full Code Here

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

            if (cert == null) {
                throw new KeyNotFoundException("Keystore '"+keystoreName+"' does not contain a certificate with alias'"+alias+"'.");
            }
            return cert;
        } catch (KeyStoreException e) {
            throw new KeystoreException("Unable to retrieve certificate from keystore", e);
        }
    }
View Full Code Here

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

            if (alias == null) {
                throw new KeyNotFoundException("Keystore '"+keystoreName+"' does not contain an alias corresponding to the given certificate.");
            }
            return alias;
        } catch (KeyStoreException e) {
            throw new KeystoreException("Unable to read certificate alias from keystore", e);
        }
    }
View Full Code Here

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

            if (certs == null) {
                throw new KeyNotFoundException("Keystore '"+keystoreName+"' does not contain a certificate chain with alias'"+alias+"'.");
            }
            return certs;
        } catch (KeyStoreException e) {
            throw new KeystoreException("Unable to read certificate chain from keystore", e);
        }
    }
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.