Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save coheigea/eb93405c71d6cf98f1e391b2b8f6a49d to your computer and use it in GitHub Desktop.
Save coheigea/eb93405c71d6cf98f1e391b2b8f6a49d to your computer and use it in GitHub Desktop.
KeyStore keyStore = ...
PrivateKey privateKey = (PrivateKey)keyStore.getKey("service", "security".toCharArray());
PublicKey publicKey = keyStore.getCertificate("service").getPublicKey();
TrustedRpkStore trustedRpkStore = id -> {
return true;
};
context.getRegistry().bind("privateKey", privateKey);
context.getRegistry().bind("publicKey", publicKey);
context.getRegistry().bind("trustedRpkStore", trustedRpkStore);
fromF(getProtocol() + "://localhost:%d/TestResource?privateKey=#privateKey&publicKey=#publicKey", PORT5)
.transform(body().prepend("Hello "));
from("direct:rpk")
.toF(getProtocol() + "://localhost:%d/TestResource?trustedRpkStore=#trustedRpkStore", PORT5)
.to("mock:result");
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment