int keySize = KeyTools.getKeyLength(pubK);
String alg = pubK.getAlgorithm();
log.debug("Generating new PKCS#11 "+alg+" key with spec "+paramspec+" (size="+keySize+") with label "+newKeyLabel+", on slot "+slot+", using sharedLibrary "+sharedLibrary+", and attributesFile "+attributesFile);
}
}
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
KeyStrings kstr = new KeyStrings(properties);
String certsignkeystr = kstr.getKey(SecConst.CAKEYPURPOSE_CERTSIGN);
log.debug("CAKEYPURPOSE_CERTSIGN keystring is: "+certsignkeystr);