Created
June 21, 2018 09:10
-
-
Save Gsealy/87e8f0418b8c8d8317076ff8cdd3a581 to your computer and use it in GitHub Desktop.
worker verticle
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package cn.com.infosec.vertx.worker; | |
import java.security.KeyPair; | |
import io.vertx.core.AbstractVerticle; | |
import io.vertx.core.eventbus.Message; | |
import io.vertx.core.json.JsonObject; | |
import cn.com.infosec.vertx.Constants; | |
import cn.com.infosec.xml.verify.XMLVerify; | |
public class ValidWorkerVerticle extends AbstractVerticle { | |
private KeyPair kp = Constants.kp; | |
@Override | |
public void start() throws Exception { | |
vertx.eventBus().consumer(Constants.EVENT_BUS_VALID, this::ValidWorker); | |
} | |
private void ValidWorker(Message<JsonObject> message) { | |
try { | |
XMLVerify xmlVerify = new XMLVerify(Constants.SIGNED_XMLDOC, kp.getPublic()); | |
message.reply(xmlVerify.vaildate()); | |
} catch (Exception e) { | |
e.printStackTrace(); | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment