use of iso.std.iso_iec._24727.tech.schema.CardApplicationListResponse.CardApplicationNameList in project open-ecard by ecsec.
the class TinySAL method cardApplicationList.
/**
* The CardApplicationList function returns a list of the available card applications on an eCard.
* See BSI-TR-03112-4, version 1.1.2, section 3.3.1.
*
* @param request CardApplicationList
* @return CardApplicationListResponse
*/
@Publish
@Override
public CardApplicationListResponse cardApplicationList(CardApplicationList request) {
CardApplicationListResponse response = WSHelper.makeResponse(CardApplicationListResponse.class, WSHelper.makeResultOK());
try {
ConnectionHandleType connectionHandle = SALUtils.getConnectionHandle(request);
CardStateEntry cardStateEntry = SALUtils.getCardStateEntry(states, connectionHandle, false);
/*
TR-03112-4 section 3.3.2 states that the alpha application have to be connected with
CardApplicationConnect.
In case of using CardInfo file descriptions this is not necessary because we just work on a file.
*/
// byte[] cardApplicationID = connectionHandle.getCardApplication();
// Assert.securityConditionApplication(cardStateEntry, cardApplicationID,
// CardApplicationServiceActionName.CARD_APPLICATION_LIST);
CardInfoWrapper cardInfoWrapper = cardStateEntry.getInfo();
CardApplicationNameList cardApplicationNameList = new CardApplicationNameList();
cardApplicationNameList.getCardApplicationName().addAll(cardInfoWrapper.getCardApplicationNameList());
response.setCardApplicationNameList(cardApplicationNameList);
} 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