use of org.xipki.security.pkcs11.P11Slot in project xipki by xipki.
the class SpeedP11Action method getSlot.
protected P11Slot getSlot() throws XiSecurityException, P11TokenException, IllegalCmdParamException {
P11CryptService p11Service = p11CryptServiceFactory.getP11CryptService(moduleName);
if (p11Service == null) {
throw new IllegalCmdParamException("undefined module " + moduleName);
}
P11Module module = p11Service.getModule();
P11SlotIdentifier slotId = module.getSlotIdForIndex(slotIndex);
return module.getSlot(slotId);
}
use of org.xipki.security.pkcs11.P11Slot in project xipki by xipki.
the class BSpeedP11ECKeyGenCmd method nextTester.
@Override
protected LoadExecutor nextTester() throws Exception {
ECControl control = queue.poll();
if (control == null) {
return null;
}
P11Slot slot = getSlot();
return new P11ECKeyGenLoadTest(slot, control.curveName());
}
use of org.xipki.security.pkcs11.P11Slot in project xipki by xipki.
the class BSpeedP11RSAKeyGenCmd method nextTester.
@Override
protected LoadExecutor nextTester() throws Exception {
RSAControl control = queue.poll();
if (control == null) {
return null;
}
P11Slot slot = getSlot();
return new P11RSAKeyGenLoadTest(slot, control.modulusLen(), toBigInt("0x10001"));
}
use of org.xipki.security.pkcs11.P11Slot in project xipki by xipki.
the class P11CertDeleteCmd method execute0.
@Override
protected Object execute0() throws Exception {
P11Slot slot = getSlot(moduleName, slotIndex);
P11ObjectIdentifier objectId = slot.getObjectIdForId(Hex.decode(id));
slot.removeCerts(objectId);
println("deleted certificates");
return null;
}
use of org.xipki.security.pkcs11.P11Slot in project xipki by xipki.
the class P11RSAKeyGenCmd method execute0.
@Override
protected Object execute0() throws Exception {
if (keysize % 1024 != 0) {
throw new IllegalCmdParamException("keysize is not multiple of 1024: " + keysize);
}
P11Slot slot = getSlot();
P11ObjectIdentifier objId = slot.generateRSAKeypair(keysize, toBigInt(publicExponent), label, getControl());
finalize("RSA", objId);
return null;
}
Aggregations