Search in sources :

Example 6 with IFDCapabilitiesType

use of iso.std.iso_iec._24727.tech.schema.IFDCapabilitiesType in project open-ecard by ecsec.

the class AndroidMarshaller method marshalIFDCapabilities.

private Element marshalIFDCapabilities(IFDCapabilitiesType cap, Document document) {
    Element emIFDCaps = createElementIso(document, cap.getClass().getSimpleName());
    for (BioSensorCapabilityType bioCap : cap.getBioSensorCapability()) {
        Element emBioCap = createElementIso(document, "BioSensorCapability");
        Element emIndex = createElementIso(document, "Index");
        emIndex.appendChild(document.createTextNode(bioCap.getIndex().toString()));
        emBioCap.appendChild(emIndex);
        Element emBiometricType = createElementIso(document, "BiometricType");
        emBiometricType.appendChild(document.createTextNode(bioCap.getBiometricType().toString()));
        emBioCap.appendChild(emBiometricType);
        emIFDCaps.appendChild(emBioCap);
    }
    for (DisplayCapabilityType dispType : cap.getDisplayCapability()) {
        Element emDisp = createElementIso(document, "DisplayCapability");
        Element emIndex = createElementIso(document, "Index");
        emIndex.appendChild(document.createTextNode(dispType.getIndex().toString()));
        emDisp.appendChild(emIndex);
        Element emLines = createElementIso(document, "Lines");
        emLines.appendChild(document.createTextNode(dispType.getLines().toString()));
        emDisp.appendChild(emLines);
        Element emColumns = createElementIso(document, "Columns");
        emColumns.appendChild(document.createTextNode(dispType.getColumns().toString()));
        emDisp.appendChild(emColumns);
        Element emVirLines = createElementIso(document, "VirtualLines");
        emVirLines.appendChild(document.createTextNode(dispType.getVirtualLines().toString()));
        emDisp.appendChild(emVirLines);
        Element emVirColumns = createElementIso(document, "VirtualColumns");
        emVirColumns.appendChild(document.createTextNode(dispType.getVirtualColumns().toString()));
        emDisp.appendChild(emVirColumns);
        emIFDCaps.appendChild(emDisp);
    }
    for (KeyPadCapabilityType keyPadType : cap.getKeyPadCapability()) {
        Element emKP = createElementIso(document, "KeyPadCapability");
        Element emIndex = createElementIso(document, "Index");
        emIndex.appendChild(document.createTextNode(keyPadType.getIndex().toString()));
        emKP.appendChild(emIndex);
        Element emKeys = createElementIso(document, "Keys");
        emKeys.appendChild(document.createTextNode(keyPadType.getKeys().toString()));
        emKP.appendChild(emKeys);
        emIFDCaps.appendChild(emKP);
    }
    for (SlotCapabilityType slotType : cap.getSlotCapability()) {
        Element emSlot = createElementIso(document, "SlotCapability");
        Element emIndex = createElementIso(document, "Index");
        emIndex.appendChild(document.createTextNode(slotType.getIndex().toString()));
        emSlot.appendChild(emIndex);
        for (String protocol : slotType.getProtocol()) {
            Element emProtocol = createElementIso(document, "Protocol");
            emProtocol.appendChild(document.createTextNode(protocol));
            emSlot.appendChild(emProtocol);
        }
        emIFDCaps.appendChild(emSlot);
    }
    Element emOpticalSignalUnit = createElementIso(document, "OpticalSignalUnit");
    emOpticalSignalUnit.appendChild(document.createTextNode(Boolean.toString(cap.isOpticalSignalUnit())));
    emIFDCaps.appendChild(emOpticalSignalUnit);
    Element emAcousticSignalUnit = createElementIso(document, "AcousticSignalUnit");
    emAcousticSignalUnit.appendChild(document.createTextNode(Boolean.toString(cap.isAcousticSignalUnit())));
    emIFDCaps.appendChild(emAcousticSignalUnit);
    return emIFDCaps;
}
Also used : KeyPadCapabilityType(iso.std.iso_iec._24727.tech.schema.KeyPadCapabilityType) SlotCapabilityType(iso.std.iso_iec._24727.tech.schema.SlotCapabilityType) JAXBElement(javax.xml.bind.JAXBElement) Element(org.w3c.dom.Element) DisplayCapabilityType(iso.std.iso_iec._24727.tech.schema.DisplayCapabilityType) LocalizedString(org.openecard.addon.manifest.LocalizedString) BioSensorCapabilityType(iso.std.iso_iec._24727.tech.schema.BioSensorCapabilityType)

Example 7 with IFDCapabilitiesType

use of iso.std.iso_iec._24727.tech.schema.IFDCapabilitiesType 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)4 IFDCapabilitiesType (iso.std.iso_iec._24727.tech.schema.IFDCapabilitiesType)4 ConnectionHandleType (iso.std.iso_iec._24727.tech.schema.ConnectionHandleType)3 GetIFDCapabilities (iso.std.iso_iec._24727.tech.schema.GetIFDCapabilities)3 BioSensorCapabilityType (iso.std.iso_iec._24727.tech.schema.BioSensorCapabilityType)2 DisplayCapabilityType (iso.std.iso_iec._24727.tech.schema.DisplayCapabilityType)2 BigInteger (java.math.BigInteger)2 IfdEventObject (org.openecard.common.event.IfdEventObject)2 NoSuchTerminal (org.openecard.common.ifd.scio.NoSuchTerminal)2 SCIOException (org.openecard.common.ifd.scio.SCIOException)2 SingleThreadChannel (org.openecard.ifd.scio.wrapper.SingleThreadChannel)2 InitializeFramework (de.bund.bsi.ecard.api._1.InitializeFramework)1 ApplicationCapabilitiesType (iso.std.iso_iec._24727.tech.schema.ApplicationCapabilitiesType)1 BeginTransaction (iso.std.iso_iec._24727.tech.schema.BeginTransaction)1 BeginTransactionResponse (iso.std.iso_iec._24727.tech.schema.BeginTransactionResponse)1 CardApplicationConnect (iso.std.iso_iec._24727.tech.schema.CardApplicationConnect)1 CardApplicationConnectResponse (iso.std.iso_iec._24727.tech.schema.CardApplicationConnectResponse)1 CardApplicationDisconnect (iso.std.iso_iec._24727.tech.schema.CardApplicationDisconnect)1 CardApplicationDisconnectResponse (iso.std.iso_iec._24727.tech.schema.CardApplicationDisconnectResponse)1 CardApplicationPath (iso.std.iso_iec._24727.tech.schema.CardApplicationPath)1