public static byte[] getDecryptedBytes(CallbackHandler callbackHandler, Crypto crypto, Node encryptedKeyElement)
throws WSSecurityException {
// TODO make this code more efficient and reader friendly
EncryptedKeyProcessor encryptedKeyProcessor = new EncryptedKeyProcessor();
RequestData requestData = new RequestData();
requestData.setCallbackHandler(callbackHandler);
requestData.setDecCrypto(crypto);
final WSSConfig cfg = WSSConfig.getNewInstance();
requestData.setWssConfig(cfg);
WSDocInfo docInfo = new WSDocInfo(encryptedKeyElement.getOwnerDocument());
List<WSSecurityEngineResult> resultList
= null;
resultList = encryptedKeyProcessor.handleToken((Element) encryptedKeyElement, requestData, docInfo);
WSSecurityEngineResult wsSecurityEngineResult = resultList.get(0);
return (byte[]) wsSecurityEngineResult.get(WSSecurityEngineResult.TAG_SECRET);