/** * @param rmd */ protected void addTimestamp(RampartMessageData rmd) { log.debug("Adding timestamp"); WSSecTimestamp timestampBuilder = new WSSecTimestamp(); timestampBuilder.setWsConfig(rmd.getConfig()); timestampBuilder.setTimeToLive(RampartUtil.getTimeToLive(rmd)); // add the Timestamp to the SOAP Enevelope timestampBuilder.build(rmd.getDocument(), rmd .getSecHeader()); if (log.isDebugEnabled()) { log.debug("Timestamp id: " + timestampBuilder.getId()); } rmd.setTimestampId(timestampBuilder.getId()); this.timestampElement = timestampBuilder.getElement(); log.debug("Adding timestamp: DONE"); }
/** * Adds a new <code>Timestamp</code> to a soap envelope. * * A complete <code>Timestamp</code> is constructed and added to the * <code>wsse:Security</code> header. * * @param doc The SOAP envelope as W3C document * @param secHeader The security header that hold this Timestamp * @return Document with Timestamp added * @throws Exception */ public Document build(Document doc, WSSecHeader secHeader) { log.debug("Begin add timestamp..."); prepare(doc); prependToHeader(secHeader); return doc; }
public void execute(WSHandler handler, int actionToDo, Document doc, RequestData reqData) throws WSSecurityException { // // add the Timestamp to the SOAP Envelope // WSSecTimestamp timeStampBuilder = new WSSecTimestamp(reqData.getWssConfig()); timeStampBuilder.setTimeToLive(handler.decodeTimeToLive(reqData, true)); timeStampBuilder.build(doc, reqData.getSecHeader()); } }
wsSecHeader.insertSecurityHeader(soapPart); WSSecTimestamp wsSecTimeStamp = new WSSecTimestamp(); wsSecTimeStamp.setTimeToLive(60); wsSecTimeStamp.build(soapPart, wsSecHeader); signParts.add(new WSEncryptionPart(soapConstants.getBodyQName() .getLocalPart(), soapConstants.getEnvelopeURI(), "Content")); signParts.add(new WSEncryptionPart(wsSecTimeStamp.getId())); List<Reference> referenceList = wsSecSignature.addReferencesToSign( signParts, wsSecHeader);
utBuilder.build(doc, secHeader); WSSecTimestamp tsBuilder = new WSSecTimestamp(); tsBuilder.build(doc, secHeader);
/** * Creates a Timestamp element. * * The method prepares and initializes a WSSec Timestamp structure after the * relevant information was set. Before calling <code>prepare()</code> the * parameter such as <code>timeToLive</code> can be set if the default * value is not suitable. * * @param doc The SOAP envelope as W3C document */ public void prepare(Document doc) { ts = new Timestamp(getWsConfig().isPrecisionInMilliSeconds(), doc, getWsConfig().getCurrentTime(), timeToLive); String tsId = getWsConfig().getIdAllocator().createId("TS-", ts); ts.setID(tsId); }
wsSecHeader.insertSecurityHeader(soapPart); WSSecTimestamp wsSecTimeStamp = new WSSecTimestamp(); wsSecTimeStamp.setTimeToLive(60); wsSecTimeStamp.build(soapPart, wsSecHeader); .getLocalPart(), soapConstants.getEnvelopeURI(), "Content")); signParts.add(new WSEncryptionPart(bstId)); signParts.add(new WSEncryptionPart(wsSecTimeStamp.getId())); List<Reference> referenceList = sign.addReferencesToSign(signParts, wsSecHeader);
public void execute(WSHandler handler, int actionToDo, Document doc, RequestData reqData) throws WSSecurityException { // // add the Timestamp to the SOAP Envelope // WSSecTimestamp timeStampBuilder = new WSSecTimestamp(reqData.getWssConfig()); timeStampBuilder.setTimeToLive(handler.decodeTimeToLive(reqData, true)); timeStampBuilder.build(doc, reqData.getSecHeader()); } }
utBuilder.build(doc, secHeader); WSSecTimestamp tsBuilder = new WSSecTimestamp(); tsBuilder.build(doc, secHeader);
/** * Creates a Timestamp element. * * The method prepares and initializes a WSSec Timestamp structure after the * relevant information was set. Before calling <code>prepare()</code> the * parameter such as <code>timeToLive</code> can be set if the default * value is not suitable. * * @param doc The SOAP envelope as W3C document */ public void prepare(Document doc) { ts = new Timestamp(getWsConfig().isPrecisionInMilliSeconds(), doc, getWsConfig().getCurrentTime(), timeToLive); String tsId = getWsConfig().getIdAllocator().createId("TS-", ts); ts.setID(tsId); }
wsSecHeader.insertSecurityHeader(soapPart); WSSecTimestamp wsSecTimeStamp = new WSSecTimestamp(); wsSecTimeStamp.setTimeToLive(0); wsSecTimeStamp.build(soapPart, wsSecHeader); sign.appendBSTElementToHeader(wsSecHeader); Vector<WSEncryptionPart> signParts = new Vector<WSEncryptionPart>(); signParts.add(new WSEncryptionPart(wsSecTimeStamp.getId())); SOAPConstants soapConstants = WSSecurityUtil .getSOAPConstants(soapPart.getDocumentElement());
utBuilder.build(doc, secHeader); WSSecTimestamp tsBuilder = new WSSecTimestamp(); tsBuilder.build(doc, secHeader);
/** * Adds a new <code>Timestamp</code> to a soap envelope. * * A complete <code>Timestamp</code> is constructed and added to the * <code>wsse:Security</code> header. * * @param doc The SOAP envelope as W3C document * @param secHeader The security header that hold this Timestamp * @return Document with Timestamp added * @throws Exception */ public Document build(Document doc, WSSecHeader secHeader) { log.debug("Begin add timestamp..."); prepare(doc); prependToHeader(secHeader); return doc; }