Skip to content

Instantly share code, notes, and snippets.

@Gsealy
Created June 21, 2018 09:10
Show Gist options
  • Save Gsealy/87e8f0418b8c8d8317076ff8cdd3a581 to your computer and use it in GitHub Desktop.
Save Gsealy/87e8f0418b8c8d8317076ff8cdd3a581 to your computer and use it in GitHub Desktop.
worker verticle
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