Search in sources :

Example 21 with DynamicContext

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;
    }
}
Also used : DynamicContext(org.openecard.common.DynamicContext)

Example 22 with DynamicContext

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;
}
Also used : FuturePromise(org.openecard.common.util.FuturePromise) Promise(org.openecard.common.util.Promise) DynamicContext(org.openecard.common.DynamicContext)

Aggregations

DynamicContext (org.openecard.common.DynamicContext)22 URL (java.net.URL)5 MalformedURLException (java.net.MalformedURLException)4 ObjectSchemaValidator (org.openecard.common.interfaces.ObjectSchemaValidator)4 ObjectValidatorException (org.openecard.common.interfaces.ObjectValidatorException)4 Promise (org.openecard.common.util.Promise)4 ConnectionHandleType (iso.std.iso_iec._24727.tech.schema.ConnectionHandleType)3 DIDAuthenticateResponse (iso.std.iso_iec._24727.tech.schema.DIDAuthenticateResponse)3 Pair (org.openecard.common.util.Pair)3 StepActionResult (org.openecard.gui.executor.StepActionResult)3 DIDAuthenticate (iso.std.iso_iec._24727.tech.schema.DIDAuthenticate)2 IOException (java.io.IOException)2 BigInteger (java.math.BigInteger)2 URISyntaxException (java.net.URISyntaxException)2 InvalidAddressException (org.openecard.binding.tctoken.ex.InvalidAddressException)2 UserCancellationException (org.openecard.binding.tctoken.ex.UserCancellationException)2 TlsServerCertificate (org.openecard.bouncycastle.tls.TlsServerCertificate)2 CardVerifiableCertificate (org.openecard.crypto.common.asn1.cvc.CardVerifiableCertificate)2 CardVerifiableCertificateChain (org.openecard.crypto.common.asn1.cvc.CardVerifiableCertificateChain)2 UserConsentNavigator (org.openecard.gui.UserConsentNavigator)2