Examples of KeystoreException


Examples of java.security.KeyStoreException

        Certificate[] chain)
        throws KeyStoreException
    {
        if (!(key instanceof PrivateKey))
        {
            throw new KeyStoreException("PKCS12 does not support non-PrivateKeys");
        }

        if ((key instanceof PrivateKey) && (chain == null))
        {
            throw new KeyStoreException("no certificate chain for private key");
        }

        if (keys.get(alias) != null)
        {
            engineDeleteEntry(alias);
View Full Code Here

Examples of java.security.KeyStoreException

        } else if (this.keystore.isKeyEntry(alias)) {
            // private key entry
            info = new KeyEntryInfo(alias, "private key", keystore
                    .getCreationDate(alias));
        } else {
            throw new KeyStoreException("invalid key entry type");
        }
        return info;
    }
View Full Code Here

Examples of java.security.KeyStoreException

            certs = new Certificate[1];
            certs[0] = cert;
        } else if (keystore.isKeyEntry(alias)) {
            certs = keystore.getCertificateChain(alias);
        } else if (keystore.containsAlias(alias)) {
            throw new KeyStoreException("Unsupported key-store-entry, alias = "
                    + alias);
        } else {
            throw new KeyStoreException(
                    "Key-store-entry alias not found, alias = " + alias);
        }

        return certs;
    }
View Full Code Here

Examples of java.security.KeyStoreException

        PKCS10CertificationRequest csr = new PKCS10CertificationRequest(sigalg,
                subject, publicKey, attributes, signingKey);

        if (!csr.verify()) {
            throw new KeyStoreException("CSR verification failed");
        }

        ByteArrayOutputStream os = new ByteArrayOutputStream();
        DEROutputStream deros = new DEROutputStream(os);
        deros.writeObject(csr.getDERObject());
View Full Code Here

Examples of java.security.KeyStoreException

        PKCS10CertificationRequest csr = new PKCS10CertificationRequest(sigalg,
                subject, publicKey, attributes, signingKey);

        if (!csr.verify()) {
            throw new KeyStoreException("CSR verification failed");
        }

        ByteArrayOutputStream os = new ByteArrayOutputStream();
        DEROutputStream deros = new DEROutputStream(os);
        deros.writeObject(csr.getDERObject());
View Full Code Here

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

                                                                            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

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

        // 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

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

            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

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

            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

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

                    fingerprints.put(alias, CertificateUtil.generateFingerprint(instance.getCertificate(alias, password), "MD5"));
                }
            } catch (KeystoreException e) {
                throw e;
            } catch (Exception e) {
                throw new KeystoreException("Unable to import trust certificate", 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.