Package org.ejbca.util.keystore

Examples of org.ejbca.util.keystore.KeyStoreContainer.generate()


            final String dn = CertTools.stringToBCDNString(StringTools.strip(args[6]));
            final int validity = Integer.parseInt(args[7]);
            HardCATokenInfo catokeninfo = new HardCATokenInfo();
            byte keyStoreID[];{
                KeyStoreContainer ksc = KeyStoreContainerFactory.getInstance(args[4],args[2], args[3], args.length>8 ? args[8] : null, null, null);
                ksc.generate("2048", DEFAULT_KEY);
                ksc.generate("2048", SIGN_KEY);
                keyStoreID = ksc.storeKeyStore();
                catokeninfo.setAuthenticationCode(new String(ksc.getPassPhraseGetSetEntry()));
            }
            getLogger().info("Initializing CA");           
View Full Code Here


            final int validity = Integer.parseInt(args[7]);
            HardCATokenInfo catokeninfo = new HardCATokenInfo();
            byte keyStoreID[];{
                KeyStoreContainer ksc = KeyStoreContainerFactory.getInstance(args[4],args[2], args[3], args.length>8 ? args[8] : null, null, null);
                ksc.generate("2048", DEFAULT_KEY);
                ksc.generate("2048", SIGN_KEY);
                keyStoreID = ksc.storeKeyStore();
                catokeninfo.setAuthenticationCode(new String(ksc.getPassPhraseGetSetEntry()));
            }
            getLogger().info("Initializing CA");           
            getLogger().info("Generating rootCA keystore:");
View Full Code Here

                if ( args[1].toLowerCase().trim().contains(GENERATE_MODULE_SWITCH) ) {
                    setModuleProtection();
                }
                KeyStoreContainer store = KeyStoreContainerFactory.getInstance(args[4], args[2], args[3], args.length>7 ? args[7] : null, null, null);
                String keyEntryName = args.length>6 ? args[6] :"myKey";
                store.generate(args[5], keyEntryName);
                System.err.println("Created certificate with entry "+keyEntryName+'.');
            }
            return true;
        }
        if ( args[1].toLowerCase().trim().equals(DELETE_SWITCH)) {
View Full Code Here

        }
        KeyStoreContainer cont = KeyStoreContainerFactory.getInstance(KeyStoreContainer.KEYSTORE_TYPE_PKCS11, token.getProvider(), pwp);
        cont.setPassPhraseLoadSave(authCode);
        if (keyspec != null) {
          log.debug("Generating from string keyspec: "+keyspec);
          cont.generate(keyspec, newKeyLabel);
        } else {
          log.debug("Generating from AlgorithmParameterSpec: "+paramspec);
          cont.generate(paramspec, newKeyLabel);
        }
        // Set properties so that we will start using the new key, or not, depending on the activate argument
View Full Code Here

        if (keyspec != null) {
          log.debug("Generating from string keyspec: "+keyspec);
          cont.generate(keyspec, newKeyLabel);
        } else {
          log.debug("Generating from AlgorithmParameterSpec: "+paramspec);
          cont.generate(paramspec, newKeyLabel);
        }
        // Set properties so that we will start using the new key, or not, depending on the activate argument
        KeyStrings kstr = new KeyStrings(properties);
        String certsignkeystr = kstr.getKey(SecConst.CAKEYPURPOSE_CERTSIGN);
        log.debug("CAKEYPURPOSE_CERTSIGN keystring is: "+certsignkeystr);
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.