/** * Constructor. * <p/> * * @param errorCode * @param msgId * @param args */ public WSSecurityException(int errorCode, String msgId, Object[] args) { super(getMessage(errorCode, msgId, args)); this.errorCode = errorCode; }
/** * Constructor. * <p/> * * @param errorCode * @param msgId * @param args */ public WSSecurityException(int errorCode, String msgId, Object[] args) { super(getMessage(errorCode, msgId, args)); this.errorCode = errorCode; }
/** * Constructor. * <p/> * * @param errorCode * @param msgId * @param args * @param exception */ public WSSecurityException(int errorCode, String msgId, Object[] args, Throwable exception) { super(getMessage(errorCode, msgId, args), exception); this.errorCode = errorCode; }
/** * Constructor. * <p/> * * @param errorCode * @param msgId * @param args * @param exception */ public WSSecurityException(int errorCode, String msgId, Object[] args, Throwable exception) { super(getMessage(errorCode, msgId, args), exception); this.errorCode = errorCode; }
/** * This static method generates a 128 bit salt value as defined in WSS * Username Token Profile. * * @param useForMac If <code>true</code> define the Salt for use in a MAC * @return Returns the 128 bit salt value as byte array */ public static byte[] generateSalt(boolean useForMac) { byte[] saltValue = null; try { saltValue = WSSecurityUtil.generateNonce(16); } catch (WSSecurityException ex) { LOG.debug(ex.getMessage(), ex); return null; } if (useForMac) { saltValue[0] = 0x01; } else { saltValue[0] = 0x02; } return saltValue; }
/** * This static method generates a 128 bit salt value as defined in WSS * Username Token Profile. * * @param useForMac If <code>true</code> define the Salt for use in a MAC * @return Returns the 128 bit salt value as byte array */ public static byte[] generateSalt(boolean useForMac) { byte[] saltValue = null; try { saltValue = WSSecurityUtil.generateNonce(16); } catch (WSSecurityException ex) { LOG.debug(ex.getMessage(), ex); return null; } if (useForMac) { saltValue[0] = 0x01; } else { saltValue[0] = 0x02; } return saltValue; }
/** * Creates and adds a Nonce element to this UsernameToken */ public void addNonce(Document doc) { if (elementNonce != null) { return; } byte[] nonceValue = null; try { nonceValue = WSSecurityUtil.generateNonce(16); } catch (WSSecurityException ex) { LOG.debug(ex.getMessage(), ex); return; } elementNonce = doc.createElementNS(WSConstants.WSSE_NS, "wsse:" + WSConstants.NONCE_LN); elementNonce.appendChild(doc.createTextNode(Base64.encode(nonceValue))); elementNonce.setAttributeNS(null, "EncodingType", BASE64_ENCODING); element.appendChild(elementNonce); }
/** * Creates and adds a Nonce element to this UsernameToken */ public void addNonce(Document doc) { if (elementNonce != null) { return; } byte[] nonceValue = null; try { nonceValue = WSSecurityUtil.generateNonce(16); } catch (WSSecurityException ex) { LOG.debug(ex.getMessage(), ex); return; } elementNonce = doc.createElementNS(WSConstants.WSSE_NS, "wsse:" + WSConstants.NONCE_LN); elementNonce.appendChild(doc.createTextNode(Base64.encode(nonceValue))); elementNonce.setAttributeNS(null, "EncodingType", BASE64_ENCODING); element.appendChild(elementNonce); }
LOG.debug(ex.getMessage(), ex);
public InvocationResponse invoke(MessageContext msgContext) throws AxisFault { if (!msgContext.isEngaged(WSSHandlerConstants.SECURITY_MODULE_NAME)) { return InvocationResponse.CONTINUE; } MessageBuilder builder = new MessageBuilder(); try { builder.build(msgContext); } catch (WSSecurityException e) { throw new AxisFault(e.getMessage(), e); } catch (WSSPolicyException e) { throw new AxisFault(e.getMessage(), e); } catch (RampartException e) { // If a framework exception is occurred while processing a security fault // send the original fault to the client. if (msgContext.isProcessingFault()) { return InvocationResponse.CONTINUE; } else { throw new AxisFault(e.getMessage(), e); } } if(mlog.isDebugEnabled()){ mlog.debug("*********************** RampartSender sent out \n" + msgContext.getEnvelope()); } return InvocationResponse.CONTINUE; }
LOG.debug(ex.getMessage(), ex);
document, null, null, crypto); } catch (WSSecurityException e) { LOG.debug("WS-Security error: " + e.getMessage(), e); throw new SecurityException("WS-Security error: " + e.getMessage(), e);
document, null, null, null); } catch (WSSecurityException e) { LOG.debug("WS-Security error: " + e.getMessage(), e); throw createSOAPFaultException( "The signature or decryption was invalid", "FailedCheck");
trustService.logAudit("WS-Security error: " + e.getMessage()); throw new RuntimeException("WSS4J error: " + e.getMessage(), e); } catch (KeyStoreLoadException e) { trustService.logAudit("Load keystore error: " + e.getMessage());
LOG.debug(ex.getMessage(), ex);
} catch (WSSecurityException e) { logger.log(Logger.LT_EXCEPTION, "Failed while signing requeest for , '" + merchantID + "'"); throw new SignException(e.getMessage());
LOG.debug(ex.getMessage(), ex);