WSSConfig wssConfig = WSSConfig.getNewInstance();
RequestData data = new RequestData();
data.setCallbackHandler(new UsernamePasswordCallbackHandler());
data.setWssConfig(wssConfig);
data.setNonceReplayCache(new MemoryReplayCache());
// Successfully verify UsernameToken
verify(signedDoc, wssConfig, data);
// Now try again - a replay attack should be detected