Examples of containsAlias()


Examples of java.security.KeyStore.containsAlias()

        // if the generated certificate shouldn't be self-signed
        // but should be signed with a chain.
        boolean selfSigned = (param.getIssuerAlias() == null);
        if (!selfSigned) {
            String issuerAlias = param.getIssuerAlias();
            if (!keyStore.containsAlias(issuerAlias)) {
                throw new KeytoolException("Certificate issuer alias <"
                        + issuerAlias + "> does not exist.");
            }

            if (!keyStore.entryInstanceOf(issuerAlias,
View Full Code Here

Examples of java.security.KeyStore.containsAlias()

            CertPathBuilderException, IOException, KeytoolException,
            NoSuchProviderException, KeyStoreException {

        String alias = param.getAlias();
        KeyStore keyStore = param.getKeyStore();
        boolean contains = keyStore.containsAlias(alias);
        String certProvider = (param.getCertProvider() != null) ? param
                .getCertProvider() : param.getProvider();

        // if the alias already exists, try to import the certificate as
        // a cert reply
View Full Code Here

Examples of java.security.KeyStore.containsAlias()

        // check if the alias exists
        if (command == Command.CERTREQ || command == Command.DELETE
                || command == Command.EXPORT || command == Command.KEYCLONE
                || command == Command.KEYPASSWD || command == Command.SELFCERT
                || (command == Command.LIST && param.getAlias() != null)) {
            if (!keyStore.containsAlias(param.getAlias())) {
                throw new KeytoolException("Alias <" + alias
                        + "> doesn't exist");
            }
        } else if (command == Command.GENKEY){
            if (keyStore.containsAlias(param.getAlias())) {
View Full Code Here

Examples of java.security.KeyStore.containsAlias()

            if (!keyStore.containsAlias(param.getAlias())) {
                throw new KeytoolException("Alias <" + alias
                        + "> doesn't exist");
            }
        } else if (command == Command.GENKEY){
            if (keyStore.containsAlias(param.getAlias())) {
                throw new KeytoolException("Key(s) not generated, alias <"
                        + alias + "> already exists.");
            }
        }
View Full Code Here

Examples of java.security.KeyStore.containsAlias()

                        || command == Command.CERTREQ
                        || command == Command.KEYPASSWD
                        || command == Command.SELFCERT
                // if keystore contains alias, import of a certificate reply
                // is considered, otherwise password is unnecessary.
                || (command == Command.IMPORT && keyStore.containsAlias(alias)))) {
            param.setKeyPass(tryStorePassAsKeyPass(keyStore, alias, param
                    .getStorePass()));
        }
       
        switch (command) {
View Full Code Here

Examples of java.security.KeyStore.containsAlias()

          // -> delete the specified entry and save back to disk
          FileInputStream fsIn = new FileInputStream( pathToKeystore );
          KeyStore certStore = KeyStore.getInstance( "JKS" );
          certStore.load( fsIn, keystorePassword.toCharArray());

          if ( certStore.containsAlias( accessKey[0] )) {
                certStore.deleteEntry( accessKey[0] );
                FileOutputStream fsOut = new FileOutputStream( pathToKeystore );
               certStore.store( fsOut, keystorePassword.toCharArray());
              
              // -> dis-associate the cert's uniqueId with the Cloud API keys
View Full Code Here

Examples of java.security.KeyStore.containsAlias()

                // read the result
                KeyStore keyStore = KeyStoreLoaderSaver.loadStore(keyStorePath,
                        args[6], TestUtils.ksPass.toCharArray(), null);
                // check the result
                assertTrue(errMsgPrefix + "alias " + curAlias
                        + " does not exist in keystore", keyStore
                        .containsAlias(curAlias));
                assertTrue(errMsgPrefix + "alias " + curAlias
                        + " is not a key entry", keyStore.isKeyEntry(curAlias));
                Key key = keyStore.getKey(curAlias, TestUtils.keyPass
                        .toCharArray());
View Full Code Here

Examples of java.security.KeyStore.containsAlias()

            CertPathBuilderException, IOException, KeytoolException,
            NoSuchProviderException, KeyStoreException {

        String alias = param.getAlias();
        KeyStore keyStore = param.getKeyStore();
        boolean contains = keyStore.containsAlias(alias);
        String certProvider = (param.getCertProvider() != null) ? param
                .getCertProvider() : param.getProvider();

        // if the alias already exists, try to import the certificate as
        // a cert reply
View Full Code Here

Examples of java.security.KeyStore.containsAlias()

        // check if the alias exists
        if (command == Command.CERTREQ || command == Command.DELETE
                || command == Command.EXPORT || command == Command.KEYCLONE
                || command == Command.KEYPASSWD || command == Command.SELFCERT
                || (command == Command.LIST && param.getAlias() != null)) {
            if (!keyStore.containsAlias(param.getAlias())) {
                throw new KeytoolException("Alias <" + alias
                        + "> doesn't exist");
            }
        } else if (command == Command.GENKEY){
            if (keyStore.containsAlias(param.getAlias())) {
View Full Code Here

Examples of java.security.KeyStore.containsAlias()

            if (!keyStore.containsAlias(param.getAlias())) {
                throw new KeytoolException("Alias <" + alias
                        + "> doesn't exist");
            }
        } else if (command == Command.GENKEY){
            if (keyStore.containsAlias(param.getAlias())) {
                throw new KeytoolException("Key(s) not generated, alias <"
                        + alias + "> already exists.");
            }
        }
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.