Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save coheigea/4eb3b0d6c452809b95f68bc9cc94b630 to your computer and use it in GitHub Desktop.
Save coheigea/4eb3b0d6c452809b95f68bc9cc94b630 to your computer and use it in GitHub Desktop.
KeyGenerator keyGenerator = KeyGenerator.getInstance("AES");
PskStore pskStore = new StaticPskStore("some-identity", keyGenerator.generateKey().getEncoded());
context.getRegistry().bind("pskStore", pskStore);
fromF(getProtocol() + "://localhost:%d/TestResource?pskStore=#pskStore", PORT7)
.transform(body().prepend("Hello "));
from("direct:psk")
.toF(getProtocol() + "://localhost:%d/TestResource?pskStore=#pskStore", PORT7)
.to("mock:result");
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment