TinySAL implements SAL { @Publish @Override public DIDAuthenticateResponse didAuthenticate(DIDAuthenticate request) { DIDAuthenticateResponse response = WSHelper.makeResponse(DIDAuthenticateResponse.class, WSHelper.makeResultOK()); String protocolURI = ""; try { ConnectionHandleType connectionHandle = SALUtils.getConnectionHandle(request); DIDAuthenticationDataType didAuthenticationData = request.getAuthenticationProtocolData(); Assert.assertIncorrectParameter(didAuthenticationData, "The parameter AuthenticationProtocolData is empty."); protocolURI = didAuthenticationData.getProtocol(); if (protocolURI == null) { LOG.warn("ProtocolURI was null"); protocolURI = ECardConstants.Protocol.EAC_GENERIC; } else if (protocolURI.equals("urn:oid:1.0.24727.3.0.0.7.2")) { LOG.warn("ProtocolURI was urn:oid:1.0.24727.3.0.0.7.2"); protocolURI = ECardConstants.Protocol.EAC_GENERIC; } didAuthenticationData.setProtocol(protocolURI); SALProtocol protocol = getProtocol(connectionHandle, request.getDIDScope(), protocolURI); if (protocol.hasNextStep(FunctionType.DIDAuthenticate)) { response = protocol.didAuthenticate(request); removeFinishedProtocol(connectionHandle, protocolURI, protocol); } else { throw new InappropriateProtocolForActionException("DIDAuthenticate", protocol.toString()); } } catch (ECardException ex) { LOG.debug("ECard error occurred during DIDAuthenticate execution.", ex); response.setResult(ex.getResult()); } catch (Exception ex) { LOG.error("General error occurred during DIDAuthenticate execution.", ex); throwThreadKillException(ex); response.setResult(WSHelper.makeResult(ex)); } if (response.getAuthenticationProtocolData() == null) { EmptyResponseDataType data = new EmptyResponseDataType(); data.setProtocol(protocolURI); response.setAuthenticationProtocolData(data); } return response; } TinySAL(Environment env, CardStateMap states); void setAddonManager(AddonManager manager); @Override InitializeResponse initialize(Initialize request); @Override TerminateResponse terminate(Terminate request); @Override CardApplicationPathResponse cardApplicationPath(CardApplicationPath request); @Override CardApplicationConnectResponse cardApplicationConnect(CardApplicationConnect request); @Override CardApplicationSelectResponse cardApplicationSelect(CardApplicationSelect request); @Override CardApplicationDisconnectResponse cardApplicationDisconnect(CardApplicationDisconnect request); @Publish @Override CardApplicationStartSessionResponse cardApplicationStartSession(CardApplicationStartSession request); @Publish @Override CardApplicationEndSessionResponse cardApplicationEndSession(CardApplicationEndSession request); @Publish @Override CardApplicationListResponse cardApplicationList(CardApplicationList request); @Override CardApplicationCreateResponse cardApplicationCreate(CardApplicationCreate request); @Override CardApplicationDeleteResponse cardApplicationDelete(CardApplicationDelete request); @Publish @Override CardApplicationServiceListResponse cardApplicationServiceList(CardApplicationServiceList request); @Override CardApplicationServiceCreateResponse cardApplicationServiceCreate(CardApplicationServiceCreate request); @Override CardApplicationServiceLoadResponse cardApplicationServiceLoad(CardApplicationServiceLoad request); @Override CardApplicationServiceDeleteResponse cardApplicationServiceDelete(CardApplicationServiceDelete request); @Publish @Override CardApplicationServiceDescribeResponse cardApplicationServiceDescribe(CardApplicationServiceDescribe request); @Override ExecuteActionResponse executeAction(ExecuteAction request); @Publish @Override DataSetListResponse dataSetList(DataSetList request); @Override DataSetCreateResponse dataSetCreate(DataSetCreate request); @Publish @Override DataSetSelectResponse dataSetSelect(DataSetSelect request); @Override DataSetDeleteResponse dataSetDelete(DataSetDelete request); @Publish @Override DSIListResponse dsiList(DSIList request); @Override DSICreateResponse dsiCreate(DSICreate request); @Override DSIDeleteResponse dsiDelete(DSIDelete request); @Publish @Override DSIWriteResponse dsiWrite(DSIWrite request); @Publish @Override DSIReadResponse dsiRead(DSIRead request); @Publish @Override EncipherResponse encipher(Encipher request); @Override DecipherResponse decipher(Decipher request); @Publish @Override GetRandomResponse getRandom(GetRandom request); @Publish @Override HashResponse hash(Hash request); @Override SignResponse sign(Sign request); @Override VerifySignatureResponse verifySignature(VerifySignature request); @Override VerifyCertificateResponse verifyCertificate(VerifyCertificate request); @Publish @Override DIDListResponse didList(DIDList request); @Override DIDCreateResponse didCreate(DIDCreate request); @Publish @Override DIDGetResponse didGet(DIDGet request); @Override DIDUpdateResponse didUpdate(DIDUpdate request); @Override DIDDeleteResponse didDelete(DIDDelete request); @Publish @Override DIDAuthenticateResponse didAuthenticate(DIDAuthenticate request); @Publish @Override ACLListResponse aclList(ACLList request); @Override ACLModifyResponse aclModify(ACLModify request); void setGUI(UserConsent uc);  }
@Test(enabled = TESTS_ENABLED) public void testDidAuthenticate() throws ParserConfigurationException { System.out.println("didAuthenticate"); DIDAuthenticate parameters = new DIDAuthenticate(); DIDAuthenticateResponse result = instance.didAuthenticate(parameters); assertEquals(ECardConstants.Major.ERROR, result.getResult().getResultMajor()); }