protected WSSecTimestamp createTimestamp() { if (binding.isIncludeTimestamp()) { Object o = message.getContextualProperty(SecurityConstants.TIMESTAMP_TTL); int ttl = 300; //default is 300 seconds if (o instanceof Number) { ttl = ((Number)o).intValue(); } else if (o instanceof String) { ttl = Integer.parseInt((String)o); } if (ttl <= 0) { ttl = 300; } timestampEl = new WSSecTimestamp(secHeader); timestampEl.setIdAllocator(wssConfig.getIdAllocator()); timestampEl.setWsTimeSource(wssConfig.getCurrentTime()); timestampEl.setTimeToLive(ttl); timestampEl.prepare(); String namespace = binding.getName().getNamespaceURI(); PolicyUtils.assertPolicy(aim, new QName(namespace, SPConstants.INCLUDE_TIMESTAMP)); } return timestampEl; }
protected WSSecTimestamp createTimestamp() { if (binding.isIncludeTimestamp()) { Object o = message.getContextualProperty(SecurityConstants.TIMESTAMP_TTL); int ttl = 300; //default is 300 seconds if (o instanceof Number) { ttl = ((Number)o).intValue(); } else if (o instanceof String) { ttl = Integer.parseInt((String)o); } if (ttl <= 0) { ttl = 300; } timestampEl = new WSSecTimestamp(secHeader); timestampEl.setIdAllocator(wssConfig.getIdAllocator()); timestampEl.setWsTimeSource(wssConfig.getCurrentTime()); timestampEl.setTimeToLive(ttl); timestampEl.prepare(); String namespace = binding.getName().getNamespaceURI(); PolicyUtils.assertPolicy(aim, new QName(namespace, SPConstants.INCLUDE_TIMESTAMP)); } return timestampEl; }
public void execute(WSHandler handler, SecurityActionToken actionToken, RequestData reqData) throws WSSecurityException { // // add the Timestamp to the SOAP Envelope // WSSecTimestamp timeStampBuilder = new WSSecTimestamp(reqData.getSecHeader()); timeStampBuilder.setIdAllocator(reqData.getWssConfig().getIdAllocator()); timeStampBuilder.setPrecisionInMilliSeconds(reqData.isPrecisionInMilliSeconds()); timeStampBuilder.setTimeToLive(reqData.getTimeStampTTL()); timeStampBuilder.setWsTimeSource(reqData.getWssConfig().getCurrentTime()); timeStampBuilder.setWsDocInfo(reqData.getWsDocInfo()); timeStampBuilder.setExpandXopInclude(reqData.isExpandXopInclude()); timeStampBuilder.build(); } }