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;
}
Aggregations