Search in sources :

Example 1 with DSINameListType

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

the class TinySAL method dsiList.

/**
 * The function DSIList supplies the list of the DSI (Data Structure for Interoperability) which exist in the
 * selected data set.
 * See BSI-TR-03112-4, version 1.1.2, section 3.4.5. <br>
 * <br>
 * Prerequisites: <br>
 * - a connection to a card application has been established <br>
 * - a data set has been selected <br>
 *
 * @param request DSIList
 * @return DSIListResponse
 */
@Publish
@Override
public DSIListResponse dsiList(DSIList request) {
    DSIListResponse response = WSHelper.makeResponse(DSIListResponse.class, WSHelper.makeResultOK());
    try {
        ConnectionHandleType connectionHandle = SALUtils.getConnectionHandle(request);
        CardStateEntry cardStateEntry = SALUtils.getCardStateEntry(states, connectionHandle, false);
        CardInfoWrapper cardInfoWrapper = cardStateEntry.getInfo();
        byte[] cardApplicationID = connectionHandle.getCardApplication();
        if (cardStateEntry.getFCPOfSelectedEF() == null) {
            throw new PrerequisitesNotSatisfiedException("No EF selected.");
        }
        DataSetInfoType dataSet = cardInfoWrapper.getDataSetByFid(cardStateEntry.getFCPOfSelectedEF().getFileIdentifiers().get(0));
        Assert.securityConditionDataSet(cardStateEntry, cardApplicationID, dataSet.getDataSetName(), NamedDataServiceActionName.DSI_LIST);
        DSINameListType dsiNameList = new DSINameListType();
        for (DSIType dsi : dataSet.getDSI()) {
            dsiNameList.getDSIName().add(dsi.getDSIName());
        }
        response.setDSINameList(dsiNameList);
    } catch (ECardException e) {
        response.setResult(e.getResult());
    } catch (Exception e) {
        LOG.error(e.getMessage(), e);
        throwThreadKillException(e);
        response.setResult(WSHelper.makeResult(e));
    }
    return response;
}
Also used : DSIListResponse(iso.std.iso_iec._24727.tech.schema.DSIListResponse) ConnectionHandleType(iso.std.iso_iec._24727.tech.schema.ConnectionHandleType) ECardException(org.openecard.common.ECardException) CardStateEntry(org.openecard.common.sal.state.CardStateEntry) PrerequisitesNotSatisfiedException(org.openecard.common.sal.exception.PrerequisitesNotSatisfiedException) DSIType(iso.std.iso_iec._24727.tech.schema.DSIType) CardInfoWrapper(org.openecard.common.sal.state.cif.CardInfoWrapper) DataSetInfoType(iso.std.iso_iec._24727.tech.schema.DataSetInfoType) DSINameListType(iso.std.iso_iec._24727.tech.schema.DSINameListType) PrerequisitesNotSatisfiedException(org.openecard.common.sal.exception.PrerequisitesNotSatisfiedException) NameExistsException(org.openecard.common.sal.exception.NameExistsException) AddonNotFoundException(org.openecard.addon.AddonNotFoundException) ThreadTerminateException(org.openecard.common.ThreadTerminateException) ECardException(org.openecard.common.ECardException) NamedEntityNotFoundException(org.openecard.common.sal.exception.NamedEntityNotFoundException) UnknownProtocolException(org.openecard.common.sal.exception.UnknownProtocolException) IncorrectParameterException(org.openecard.common.sal.exception.IncorrectParameterException) InappropriateProtocolForActionException(org.openecard.common.sal.exception.InappropriateProtocolForActionException) TLVException(org.openecard.common.tlv.TLVException) SecurityConditionNotSatisfiedException(org.openecard.common.sal.exception.SecurityConditionNotSatisfiedException) UnknownConnectionHandleException(org.openecard.common.sal.exception.UnknownConnectionHandleException) Publish(org.openecard.common.interfaces.Publish)

Aggregations

ConnectionHandleType (iso.std.iso_iec._24727.tech.schema.ConnectionHandleType)1 DSIListResponse (iso.std.iso_iec._24727.tech.schema.DSIListResponse)1 DSINameListType (iso.std.iso_iec._24727.tech.schema.DSINameListType)1 DSIType (iso.std.iso_iec._24727.tech.schema.DSIType)1 DataSetInfoType (iso.std.iso_iec._24727.tech.schema.DataSetInfoType)1 AddonNotFoundException (org.openecard.addon.AddonNotFoundException)1 ECardException (org.openecard.common.ECardException)1 ThreadTerminateException (org.openecard.common.ThreadTerminateException)1 Publish (org.openecard.common.interfaces.Publish)1 InappropriateProtocolForActionException (org.openecard.common.sal.exception.InappropriateProtocolForActionException)1 IncorrectParameterException (org.openecard.common.sal.exception.IncorrectParameterException)1 NameExistsException (org.openecard.common.sal.exception.NameExistsException)1 NamedEntityNotFoundException (org.openecard.common.sal.exception.NamedEntityNotFoundException)1 PrerequisitesNotSatisfiedException (org.openecard.common.sal.exception.PrerequisitesNotSatisfiedException)1 SecurityConditionNotSatisfiedException (org.openecard.common.sal.exception.SecurityConditionNotSatisfiedException)1 UnknownConnectionHandleException (org.openecard.common.sal.exception.UnknownConnectionHandleException)1 UnknownProtocolException (org.openecard.common.sal.exception.UnknownProtocolException)1 CardStateEntry (org.openecard.common.sal.state.CardStateEntry)1 CardInfoWrapper (org.openecard.common.sal.state.cif.CardInfoWrapper)1 TLVException (org.openecard.common.tlv.TLVException)1