如何在JMRTD 0.6.0中获取stdDomainParam参数?在JMRTD的更高版本中,它是:
try {
CardAccessFile cardAccessFile = new CardAccessFile(service.getInputStream(PassportService.EF_CARD_ACCESS));
Collection<PACEInfo> paceInfos = cardAccessFile.getPACEInfos();
if (paceInfos != null && paceInfos.size() > 0) {
PACEInfo paceInfo = paceInfos.iterator().next();
service.doPACE(bacKey, paceInfo.getObjectIdentifier(), PACEInfo.toParameterSpec(paceInfo.getParameterId()));
paceSucceeded = true;
} else {
paceSucceeded = true;
}
} catch (Exception e) {
Log.w(TAG, e);
}
在CardAccessFile的最新版本中,仅返回SecurityInfo.getProtocolOIDString()和SecurityInfo.getObjectIdentifier()
CardAccessFile cardAccessFile = new CardAccessFile(passportService.getInputStream(PassportService.EF_CARD_ACCESS));
Collection<SecurityInfo> securityInfos = cardAccessFile.getSecurityInfos();
SecurityInfo securityInfo = securityInfos.iterator().next();
passportService.doPACE(bacKey, securityInfo.getObjectIdentifier(), PACEInfo.toParameterSpec(?????) );
最佳答案
List<PACEInfo> paceInfos = new ArrayList<PACEInfo>();
if (securityInfos == null) {
return paceInfos;
}
for (SecurityInfo securityInfo: securityInfos) {
if (securityInfo instanceof PACEInfo) {
paceInfos.add((PACEInfo)securityInfo);
}
}