/** * Try to get the secret key from a CallbackHandler implementation * @param cb a CallbackHandler implementation * @return An array of bytes corresponding to the secret key (can be null) * @throws WSSecurityException */ private static byte[] getSecretKeyFromCallbackHandler( String id, CallbackHandler cb ) throws WSSecurityException { if (cb != null) { WSPasswordCallback pwcb = new WSPasswordCallback(id, WSPasswordCallback.SECRET_KEY); try { cb.handle(new Callback[]{pwcb}); } catch (Exception e1) { throw new WSSecurityException(WSSecurityException.FAILURE, "noKey", new Object[] { id }, e1); } return pwcb.getKey(); } return null; }
/** * Try to get the secret key from a CallbackHandler implementation * @param cb a CallbackHandler implementation * @return An array of bytes corresponding to the secret key (can be null) * @throws WSSecurityException */ private static byte[] getSecretKeyFromCallbackHandler( String id, CallbackHandler cb ) throws WSSecurityException { if (cb != null) { WSPasswordCallback pwcb = new WSPasswordCallback(id, WSPasswordCallback.SECRET_KEY); try { cb.handle(new Callback[]{pwcb}); } catch (Exception e1) { throw new WSSecurityException(WSSecurityException.FAILURE, "noKey", new Object[] { id }, e1); } return pwcb.getKey(); } return null; }
if (data.getCallbackHandler() != null) { data.getCallbackHandler().handle(callbacks); return pwcb.getKey();
if (data.getCallbackHandler() != null) { data.getCallbackHandler().handle(callbacks); return pwcb.getKey();
if (data.getCallbackHandler() != null) { data.getCallbackHandler().handle(callbacks); return pwcb.getKey();
if (data.getCallbackHandler() != null) { data.getCallbackHandler().handle(callbacks); return pwcb.getKey();
byte[] decryptedData = pwCb.getKey(); if (decryptedData == null) { throw new WSSecurityException(
if (data.getCallbackHandler() != null) { data.getCallbackHandler().handle(callbacks); return pwcb.getKey();
byte[] decryptedData = pwCb.getKey(); if (decryptedData == null) { throw new WSSecurityException(
if (data.getCallbackHandler() != null) { data.getCallbackHandler().handle(callbacks); return pwcb.getKey();
return callback.getKey();
byte[] key = pwcb.getKey();
WSPasswordCallback passwordCallback = handler.getPasswordCB(reqData.getEncUser(), actionToDo, callbackHandler, reqData); byte[] embeddedKey = passwordCallback.getKey(); wsEncrypt.setKey(embeddedKey); wsEncrypt.setDocument(doc); WSPasswordCallback passwordCallback = handler.getPasswordCB(reqData.getEncUser(), actionToDo, callbackHandler, reqData); wsEncrypt.setEphemeralKey(passwordCallback.getKey()); wsEncrypt.setEncryptSymmKey(reqData.getEncryptSymmetricEncryptionKey());
WSPasswordCallback passwordCallback = handler.getPasswordCB(reqData.getEncUser(), actionToDo, callbackHandler, reqData); byte[] embeddedKey = passwordCallback.getKey(); wsEncrypt.setKey(embeddedKey); wsEncrypt.setDocument(doc); WSPasswordCallback passwordCallback = handler.getPasswordCB(reqData.getEncUser(), actionToDo, callbackHandler, reqData); wsEncrypt.setEphemeralKey(passwordCallback.getKey()); wsEncrypt.setEncryptSymmKey(reqData.getEncryptSymmetricEncryptionKey());