use of iso.std.iso_iec._24727.tech.schema.PinCompareDIDUpdateDataType in project open-ecard by ecsec.
the class ChangePinInSALAction method execute.
@Override
public void execute() {
List<ConnectionHandleType> connectedCards = null;
try {
connectedCards = connectCards();
if (connectedCards.isEmpty()) {
// TODO: show no card inserted dialog
}
for (ConnectionHandleType nextCard : connectedCards) {
// pick first card, find pin DID and call didupdate
String didName = null;
try {
didName = getPinDid(nextCard);
} catch (WSException ex) {
LOG.info("Skipping card, because it has no PIN DID.");
continue;
}
DIDUpdate updateReq = new DIDUpdate();
updateReq.setConnectionHandle(nextCard);
updateReq.setDIDName(didName);
DIDUpdateDataType updateData = new PinCompareDIDUpdateDataType();
updateData.setProtocol("urn:oid:1.3.162.15480.3.0.9");
updateReq.setDIDUpdateData(updateData);
dispatcher.safeDeliver(updateReq);
}
} catch (WSException ex) {
} finally {
if (connectedCards != null) {
for (ConnectionHandleType nextHandle : connectedCards) {
CardApplicationDisconnect dr = new CardApplicationDisconnect();
dr.setConnectionHandle(nextHandle);
dr.setAction(ActionType.RESET);
dispatcher.safeDeliver(dr);
}
}
}
}
Aggregations