use of iso.std.iso_iec._24727.tech.schema.GetIFDCapabilities in project open-ecard by ecsec.
the class PACEStep method genericPACESupport.
/**
* Check if the selected card reader supports PACE.
* In that case, the reader is a standard or comfort reader.
*
* @param connectionHandle Handle describing the IFD and reader.
* @return true when card reader supports genericPACE, false otherwise.
* @throws WSHelper.WSException
*/
private boolean genericPACESupport(ConnectionHandleType connectionHandle) throws WSHelper.WSException {
// Request terminal capabilities
GetIFDCapabilities capabilitiesRequest = new GetIFDCapabilities();
capabilitiesRequest.setContextHandle(connectionHandle.getContextHandle());
capabilitiesRequest.setIFDName(connectionHandle.getIFDName());
GetIFDCapabilitiesResponse capabilitiesResponse = (GetIFDCapabilitiesResponse) dispatcher.safeDeliver(capabilitiesRequest);
WSHelper.checkResult(capabilitiesResponse);
if (capabilitiesResponse.getIFDCapabilities() != null) {
List<SlotCapabilityType> capabilities = capabilitiesResponse.getIFDCapabilities().getSlotCapability();
// Check all capabilities for generic PACE
final String genericPACE = PACECapabilities.PACECapability.GenericPACE.getProtocol();
for (SlotCapabilityType capability : capabilities) {
if (capability.getIndex().equals(connectionHandle.getSlotIndex())) {
for (String protocol : capability.getProtocol()) {
if (protocol.equals(genericPACE)) {
return true;
}
}
}
}
}
// No PACE capability found
return false;
}
use of iso.std.iso_iec._24727.tech.schema.GetIFDCapabilities in project open-ecard by ecsec.
the class AbstractPINAction method genericPACESupport.
/**
* Check if the selected card reader supports PACE.
* In that case, the reader is a standard or comfort reader.
*
* @param connectionHandle Handle describing the IFD and reader.
* @return true when card reader supports genericPACE, false otherwise.
* @throws WSException In case request for the terminal capabilities returned an error.
*/
protected boolean genericPACESupport(ConnectionHandleType connectionHandle) throws WSException {
// Request terminal capabilities
GetIFDCapabilities capabilitiesRequest = new GetIFDCapabilities();
capabilitiesRequest.setContextHandle(connectionHandle.getContextHandle());
capabilitiesRequest.setIFDName(connectionHandle.getIFDName());
GetIFDCapabilitiesResponse capabilitiesResponse = (GetIFDCapabilitiesResponse) dispatcher.safeDeliver(capabilitiesRequest);
WSHelper.checkResult(capabilitiesResponse);
if (capabilitiesResponse.getIFDCapabilities() != null) {
List<SlotCapabilityType> capabilities = capabilitiesResponse.getIFDCapabilities().getSlotCapability();
// Check all capabilities for generic PACE
final String genericPACE = PACECapabilities.PACECapability.GenericPACE.getProtocol();
for (SlotCapabilityType capability : capabilities) {
if (capability.getIndex().equals(connectionHandle.getSlotIndex())) {
for (String protocol : capability.getProtocol()) {
if (protocol.equals(genericPACE)) {
return true;
}
}
}
}
}
// No PACE capability found
return false;
}
use of iso.std.iso_iec._24727.tech.schema.GetIFDCapabilities in project open-ecard by ecsec.
the class TerminalTest method testFeatures.
@Test(enabled = false)
public void testFeatures() {
init();
ifd.setGUI(new SwingUserConsent(new SwingDialogWrapper()));
Connect con = new Connect();
con.setContextHandle(ctxHandle);
con.setIFDName(ifdName);
con.setSlot(BigInteger.ZERO);
con.setExclusive(Boolean.FALSE);
slotHandle = ifd.connect(con).getSlotHandle();
GetIFDCapabilities cap = new GetIFDCapabilities();
cap.setContextHandle(ctxHandle);
cap.setIFDName(ifdName);
GetIFDCapabilitiesResponse capR = ifd.getIFDCapabilities(cap);
}
use of iso.std.iso_iec._24727.tech.schema.GetIFDCapabilities in project open-ecard by ecsec.
the class IfdEventManager method getCapabilities.
@Nullable
private IFDCapabilitiesType getCapabilities(byte[] ctxHandle, String ifdName) {
GetIFDCapabilities req = new GetIFDCapabilities();
req.setContextHandle(ctxHandle);
req.setIFDName(ifdName);
GetIFDCapabilitiesResponse res = (GetIFDCapabilitiesResponse) env.getDispatcher().safeDeliver(req);
return res.getIFDCapabilities();
}
Aggregations