use of org.xipki.security.pkcs11.P11Slot in project xipki by xipki.
the class P11IdentityDeleteCmd method execute0.
@Override
protected Object execute0() throws Exception {
P11Slot slot = getSlot();
P11ObjectIdentifier objIdentifier = getObjectIdentifier();
if (objIdentifier == null) {
println("identity to be deleted does not exist");
return null;
}
if (force || confirm("Do you want to remove the identity " + objIdentifier, 3)) {
slot.removeIdentity(objIdentifier);
println("deleted identity " + objIdentifier);
}
return null;
}
use of org.xipki.security.pkcs11.P11Slot in project xipki by xipki.
the class BSpeedP11Action 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 BSpeedP11DSAKeyGenCmd method nextTester.
@Override
protected LoadExecutor nextTester() throws Exception {
DSAControl control = queue.poll();
if (control == null) {
return null;
}
P11Slot slot = getSlot();
return new P11DSAKeyGenLoadTest(slot, control.plen(), control.qlen());
}
use of org.xipki.security.pkcs11.P11Slot in project xipki by xipki.
the class P11CertExportCmd method execute0.
@Override
protected Object execute0() throws Exception {
P11Slot slot = getSlot();
P11ObjectIdentifier objIdentifier = getObjectIdentifier();
X509Certificate cert = slot.exportCert(objIdentifier);
if (cert == null) {
throw new CmdFailure("could not export certificate " + objIdentifier);
}
saveVerbose("saved certificate to file", new File(outFile), cert.getEncoded());
return null;
}
use of org.xipki.security.pkcs11.P11Slot in project xipki by xipki.
the class P11ECKeyGenCmd method execute0.
@Override
protected Object execute0() throws Exception {
P11Slot slot = getSlot();
P11ObjectIdentifier objId = slot.generateECKeypair(curveName, label, getControl());
finalize("EC", objId);
return null;
}
Aggregations