protected void decodeDecryptionParameter(RequestData reqData) throws WSSecurityException { if (reqData.getDecCrypto() == null) { reqData.setDecCrypto(loadDecryptionCrypto(reqData)); } boolean allowRsa15 = decodeBooleanConfigValue( reqData.getMsgContext(), WSHandlerConstants.ALLOW_RSA15_KEY_TRANSPORT_ALGORITHM, false ); reqData.setAllowRSA15KeyTransportAlgorithm(allowRsa15); }
@Override public void doSenderAction( Document doc, RequestData reqData, List<HandlerAction> actions, boolean isRequest) throws WSSecurityException { super.doSenderAction(doc, reqData, actions, isRequest); }
@Override protected boolean checkReceiverResultsAnyOrder(List<WSSecurityEngineResult> wsResult, List<Integer> actions) { return super.checkReceiverResultsAnyOrder(wsResult, actions); }
/** * Overrides the WSS4J implementation so the username is correctly set in the <code>RequestData</code>. * * {@inheritDoc} */ @Override protected void decodeUTParameter(RequestData reqData) throws WSSecurityException { super.decodeUTParameter(reqData); reqData.setUsername(getStringOption(ConfigurationConstants.USER)); }
protected Crypto getCrypto(RequestData data) { return data.getSigVerCrypto(); }
/** * A hook to allow subclass to load Crypto instances from property files in a different * way. * @param propFilename The property file name * @param reqData The RequestData object * @return A Crypto instance that has been loaded */ protected Crypto loadCryptoFromPropertiesFile( String propFilename, RequestData reqData ) throws WSSecurityException { ClassLoader classLoader = this.getClassLoader(reqData.getMsgContext()); Properties properties = CryptoFactory.getProperties(propFilename, classLoader); return CryptoFactory.getInstance( properties, classLoader, getPasswordEncryptor(reqData) ); }
protected String decodePasswordType(RequestData reqData) throws WSSecurityException { String type = getString(WSHandlerConstants.PASSWORD_TYPE, reqData.getMsgContext()); if (type != null) { if (WSConstants.PW_TEXT.equals(type)) { return WSConstants.PASSWORD_TEXT; } else if (WSConstants.PW_DIGEST.equals(type)) { return WSConstants.PASSWORD_DIGEST; } } return null; }
public Credential validate(Credential credential, RequestData data) throws WSSecurityException { if (isValidatedLocally(credential, data)) { return credential; } return validateWithSTS(credential, (Message)data.getMsgContext()); }
/** * Helper to convert the WSS4J HandlerAction into a {@link Action} value. */ private org.holodeckb2b.security.Action convertAction(final HandlerAction action) { switch (action.getAction()) { case WSConstants.SIGN : return SIGN; case WSConstants.ENCR : return ENCRYPT; case WSConstants.UT : return USERNAME_TOKEN; } return null; }
/** * Hook to allow subclasses to load their Encryption Crypto however they see * fit. * * @param requestData the RequestData object * @return a Crypto instance to use for Encryption creation/verification */ protected Crypto loadEncryptionCrypto(RequestData requestData) throws WSSecurityException { return loadCrypto( WSHandlerConstants.ENC_PROP_FILE, WSHandlerConstants.ENC_PROP_REF_ID, requestData ); }
/** * Returns the option on <code>name</code>. * * @param key the non-null key of the option. * @return the option on <code>key</code> if <code>key</code> * exists and is of type java.lang.String; otherwise null. */ public String getStringOption(String key) { Object o = getOption(key); if (o instanceof String) { return (String) o; } else { return null; } }
/** * Get a CallbackHandler instance to obtain passwords. * @param reqData The RequestData which supplies the message context * @return the CallbackHandler instance to obtain passwords. * @throws WSSecurityException */ public CallbackHandler getPasswordCallbackHandler(RequestData reqData) throws WSSecurityException { return getCallbackHandler( WSHandlerConstants.PW_CALLBACK_CLASS, WSHandlerConstants.PW_CALLBACK_REF, reqData ); }
public Credential validate(Credential credential, RequestData data) throws WSSecurityException { if (isValidatedLocally(credential, data)) { return credential; } return validateWithSTS(credential, (Message)data.getMsgContext()); }
@Override public void doSenderAction( Document doc, RequestData reqData, List<HandlerAction> actions, boolean isRequest) throws WSSecurityException { super.doSenderAction(doc, reqData, actions, isRequest); }
@Override protected boolean checkReceiverResultsAnyOrder(List<WSSecurityEngineResult> wsResult, List<Integer> actions) { return super.checkReceiverResultsAnyOrder(wsResult, actions); }
/** * Hook to allow subclasses to load their Signature creation Crypto however they see * fit. * * @param requestData the RequestData object * @return a Crypto instance to use for Signature creation */ public Crypto loadSignatureCrypto(RequestData requestData) throws WSSecurityException { return loadCrypto( WSHandlerConstants.SIG_PROP_FILE, WSHandlerConstants.SIG_PROP_REF_ID, requestData ); }
@Override public void doSenderAction( Document doc, RequestData reqData, List<HandlerAction> actions, boolean isRequest) throws WSSecurityException { super.doSenderAction(doc, reqData, actions, isRequest); }
@Override protected boolean checkReceiverResultsAnyOrder(List<WSSecurityEngineResult> wsResult, List<Integer> actions) { return super.checkReceiverResultsAnyOrder(wsResult, actions); }
/** * Hook to allow subclasses to load their Decryption Crypto however they see * fit. * * @param requestData the RequestData object * @return a Crypto instance to use for Decryption creation/verification */ protected Crypto loadDecryptionCrypto(RequestData requestData) throws WSSecurityException { return loadCrypto( WSHandlerConstants.DEC_PROP_FILE, WSHandlerConstants.DEC_PROP_REF_ID, requestData ); }
/** * Hook to allow subclasses to load their Signature verification Crypto however they see * fit. * * @param requestData the RequestData object * @return a Crypto instance to use for Signature verification */ public Crypto loadSignatureVerificationCrypto(RequestData requestData) throws WSSecurityException { return loadCrypto( WSHandlerConstants.SIG_VER_PROP_FILE, WSHandlerConstants.SIG_VER_PROP_REF_ID, requestData ); }