use of org.openecard.common.DynamicContext in project open-ecard by ecsec.
the class ResourceContext method isPKIXVerify.
private static boolean isPKIXVerify() {
DynamicContext dynCtx = DynamicContext.getInstance(TR03112Keys.INSTANCE_KEY);
Promise<Object> cardTypeP = dynCtx.getPromise(TR03112Keys.ACTIVATION_CARD_TYPE);
Object cardType = cardTypeP.derefNonblocking();
// verify when the value is not set or when no nPA is requested
if (cardType != null && !"http://bsi.bund.de/cif/npa.xml".equals(cardType)) {
return true;
} else {
return false;
}
}
use of org.openecard.common.DynamicContext in project open-ecard by ecsec.
the class EACProtocol method isFinished.
@Override
public boolean isFinished() {
boolean finished = super.isFinished();
if (!finished) {
DynamicContext ctx = DynamicContext.getInstance(TR03112Keys.INSTANCE_KEY);
Promise p = ctx.getPromise(EACProtocol.AUTHENTICATION_DONE);
if (p.isDelivered()) {
try {
finished = (boolean) p.deref();
} catch (InterruptedException ex) {
// error would mean don't use the value, so this is ok to ignore
}
}
Promise p2 = ctx.getPromise(EACProtocol.AUTHENTICATION_FAILED);
if (p2.isDelivered()) {
try {
finished = (boolean) p2.deref();
} catch (InterruptedException ex) {
// error would mean don't use the value, so this is ok to ignore
}
}
}
return finished;
}
Aggregations