Examples of entryInstanceOf()


Examples of java.security.KeyStore.entryInstanceOf()

                .getCertProvider() : param.getProvider();

        // if the alias already exists, try to import the certificate as
        // a cert reply
        if (contains
                && keyStore.entryInstanceOf(alias,
                        KeyStore.PrivateKeyEntry.class)) {
            // read the certificates
            Collection<X509Certificate> certCollection = CertReader.readCerts(
                    param.getFileName(), false, certProvider);
View Full Code Here

Examples of java.security.KeyStore.entryInstanceOf()

            // true if the keystore entry is a SecretKeyEntry
            boolean secretKeyEntry = false;

            // get the type of the entry to print it out
            String entryType = "Key entry";
            if (keyStore.entryInstanceOf(currentAlias,
                    KeyStore.TrustedCertificateEntry.class)) {
                entryType = "Trusted certificate entry";
                trustedEntry = true;
            } else if (keyStore.entryInstanceOf(currentAlias,
                    KeyStore.PrivateKeyEntry.class)) {
View Full Code Here

Examples of java.security.KeyStore.entryInstanceOf()

            String entryType = "Key entry";
            if (keyStore.entryInstanceOf(currentAlias,
                    KeyStore.TrustedCertificateEntry.class)) {
                entryType = "Trusted certificate entry";
                trustedEntry = true;
            } else if (keyStore.entryInstanceOf(currentAlias,
                    KeyStore.PrivateKeyEntry.class)) {
                entryType = "Private key entry";
            } else if (keyStore.entryInstanceOf(currentAlias,
                    KeyStore.SecretKeyEntry.class)) {
                entryType = "Secret key entry";
View Full Code Here

Examples of java.security.KeyStore.entryInstanceOf()

                entryType = "Trusted certificate entry";
                trustedEntry = true;
            } else if (keyStore.entryInstanceOf(currentAlias,
                    KeyStore.PrivateKeyEntry.class)) {
                entryType = "Private key entry";
            } else if (keyStore.entryInstanceOf(currentAlias,
                    KeyStore.SecretKeyEntry.class)) {
                entryType = "Secret key entry";
                secretKeyEntry = true;
            }
View Full Code Here

Examples of java.security.KeyStore.entryInstanceOf()

            case LIST:
                if (alias != null) {
                    // This check is not where the same thing for other
                    // commands done, because (alias != null) check is
                    // necessary.
                    if (keyStore.entryInstanceOf(alias,
                            KeyStore.SecretKeyEntry.class)
                            && param.getKeyPass() == null) {
                        param.setKeyPass(tryStorePassAsKeyPass(keyStore, alias,
                                param.getStorePass()));
                    }
View Full Code Here

Examples of java.security.KeyStore.entryInstanceOf()

            if (!keyStore.containsAlias(issuerAlias)) {
                throw new KeytoolException("Certificate issuer alias <"
                        + issuerAlias + "> does not exist.");
            }

            if (!keyStore.entryInstanceOf(issuerAlias,
                    KeyStore.PrivateKeyEntry.class)) {
                throw new KeytoolException("Issuer alias <" + issuerAlias
                        + "> is not a private key entry. ");
            }
            issuerCertChain = keyStore.getCertificateChain(issuerAlias);
View Full Code Here

Examples of java.security.KeyStore.entryInstanceOf()

            CertificateException {

        String alias = param.getAlias();
        KeyStore keyStore = param.getKeyStore();

        if (!keyStore.entryInstanceOf(alias, KeyStore.PrivateKeyEntry.class)) {
            throw new KeytoolException("Failed to generate a certificate. "
                    + "Entry <" + alias + "> is not a private key entry");
        }

        // get the keys and the certificate from the keystore
View Full Code Here

Examples of java.security.KeyStore.entryInstanceOf()

            case LIST:
                if (alias != null) {
                    // This check is not where the same thing for other
                    // commands done, because (alias != null) check is
                    // necessary.
                    if (keyStore.entryInstanceOf(alias,
                            KeyStore.SecretKeyEntry.class)
                            && param.getKeyPass() == null) {
                        param.setKeyPass(tryStorePassAsKeyPass(keyStore, alias,
                                param.getStorePass()));
                    }
View Full Code Here

Examples of java.security.KeyStore.entryInstanceOf()

            if (!keyStore.containsAlias(issuerAlias)) {
                throw new KeytoolException("Certificate issuer alias <"
                        + issuerAlias + "> does not exist.");
            }

            if (!keyStore.entryInstanceOf(issuerAlias,
                    KeyStore.PrivateKeyEntry.class)) {
                throw new KeytoolException("Issuer alias <" + issuerAlias
                        + "> is not a private key entry. ");
            }
            issuerCertChain = keyStore.getCertificateChain(issuerAlias);
View Full Code Here

Examples of java.security.KeyStore.entryInstanceOf()

            CertificateException {

        String alias = param.getAlias();
        KeyStore keyStore = param.getKeyStore();

        if (!keyStore.entryInstanceOf(alias, KeyStore.PrivateKeyEntry.class)) {
            throw new KeytoolException("Failed to generate a certificate. "
                    + "Entry <" + alias + "> is not a private key entry");
        }

        // get the keys and the certificate from the keystore
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.