Search in sources :

Example 6 with GetIFDCapabilitiesResponse

use of iso.std.iso_iec._24727.tech.schema.GetIFDCapabilitiesResponse 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;
}
Also used : GetIFDCapabilities(iso.std.iso_iec._24727.tech.schema.GetIFDCapabilities) SlotCapabilityType(iso.std.iso_iec._24727.tech.schema.SlotCapabilityType) GetIFDCapabilitiesResponse(iso.std.iso_iec._24727.tech.schema.GetIFDCapabilitiesResponse)

Example 7 with GetIFDCapabilitiesResponse

use of iso.std.iso_iec._24727.tech.schema.GetIFDCapabilitiesResponse 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;
}
Also used : GetIFDCapabilities(iso.std.iso_iec._24727.tech.schema.GetIFDCapabilities) SlotCapabilityType(iso.std.iso_iec._24727.tech.schema.SlotCapabilityType) GetIFDCapabilitiesResponse(iso.std.iso_iec._24727.tech.schema.GetIFDCapabilitiesResponse)

Example 8 with GetIFDCapabilitiesResponse

use of iso.std.iso_iec._24727.tech.schema.GetIFDCapabilitiesResponse 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);
}
Also used : GetIFDCapabilities(iso.std.iso_iec._24727.tech.schema.GetIFDCapabilities) SwingDialogWrapper(org.openecard.gui.swing.SwingDialogWrapper) Connect(iso.std.iso_iec._24727.tech.schema.Connect) SwingUserConsent(org.openecard.gui.swing.SwingUserConsent) GetIFDCapabilitiesResponse(iso.std.iso_iec._24727.tech.schema.GetIFDCapabilitiesResponse) Test(org.testng.annotations.Test) AfterTest(org.testng.annotations.AfterTest)

Example 9 with GetIFDCapabilitiesResponse

use of iso.std.iso_iec._24727.tech.schema.GetIFDCapabilitiesResponse 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();
}
Also used : GetIFDCapabilities(iso.std.iso_iec._24727.tech.schema.GetIFDCapabilities) GetIFDCapabilitiesResponse(iso.std.iso_iec._24727.tech.schema.GetIFDCapabilitiesResponse) Nullable(javax.annotation.Nullable)

Aggregations

GetIFDCapabilitiesResponse (iso.std.iso_iec._24727.tech.schema.GetIFDCapabilitiesResponse)9 GetIFDCapabilities (iso.std.iso_iec._24727.tech.schema.GetIFDCapabilities)8 Connect (iso.std.iso_iec._24727.tech.schema.Connect)3 SlotCapabilityType (iso.std.iso_iec._24727.tech.schema.SlotCapabilityType)3 Result (oasis.names.tc.dss._1_0.core.schema.Result)3 BeginTransaction (iso.std.iso_iec._24727.tech.schema.BeginTransaction)2 BeginTransactionResponse (iso.std.iso_iec._24727.tech.schema.BeginTransactionResponse)2 CardApplicationConnect (iso.std.iso_iec._24727.tech.schema.CardApplicationConnect)2 CardApplicationConnectResponse (iso.std.iso_iec._24727.tech.schema.CardApplicationConnectResponse)2 CardApplicationDisconnect (iso.std.iso_iec._24727.tech.schema.CardApplicationDisconnect)2 CardApplicationDisconnectResponse (iso.std.iso_iec._24727.tech.schema.CardApplicationDisconnectResponse)2 CardApplicationPath (iso.std.iso_iec._24727.tech.schema.CardApplicationPath)2 CardApplicationPathResponse (iso.std.iso_iec._24727.tech.schema.CardApplicationPathResponse)2 CardApplicationPathType (iso.std.iso_iec._24727.tech.schema.CardApplicationPathType)2 ChannelHandleType (iso.std.iso_iec._24727.tech.schema.ChannelHandleType)2 ConnectResponse (iso.std.iso_iec._24727.tech.schema.ConnectResponse)2 ConnectionHandleType (iso.std.iso_iec._24727.tech.schema.ConnectionHandleType)2 DIDAuthenticate (iso.std.iso_iec._24727.tech.schema.DIDAuthenticate)2 DIDAuthenticateResponse (iso.std.iso_iec._24727.tech.schema.DIDAuthenticateResponse)2 DestroyChannel (iso.std.iso_iec._24727.tech.schema.DestroyChannel)2