@Override public boolean equals(Object object) { if (!(object instanceof Timestamp)) { return false; } Timestamp timestamp = (Timestamp)object; if (!compare(timestamp.getCreated(), getCreated())) { return false; } if (!compare(timestamp.getExpires(), getExpires())) { return false; } return true; }
/** * Get the timestamp element generated during <code>prepare()</code>. */ public Element getElement() { if (ts == null) { return null; } return ts.getElement(); } }
/** * Get the id generated during <code>prepare()</code>. * * Returns the the value of wsu:Id attribute of this Timestamp. * * @return Return the wsu:Id of this token or null if * <code>prepareToken()</code> was not called before. */ public String getId() { if (ts == null) { return null; } return ts.getID(); }
&& WSConstants.TIMESTAMP_TOKEN_LN.equals(((Element)sibling).getLocalName()) && WSConstants.WSU_NS.equals(((Element)sibling).getNamespaceURI())) { timeStamp = new Timestamp((Element)sibling, requestData.getWssConfig().isWsiBSPCompliant()); break; Date created = timeStamp.getCreated(); DateFormat zulu = new XmlSchemaDateFormat(); String identifier = zulu.format(created) + "" + Arrays.hashCode(signatureValue) Date expires = timeStamp.getExpires(); if (expires != null) { Date rightNow = new Date();
Date createdTime = timestamp.getCreated(); if (createdTime != null) { long now = Calendar.getInstance().getTimeInMillis(); Date expires = timestamp.getExpires();
/** * 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); }
if ((timeStampStrict && timeStamp.isExpired()) || !timeStamp.verifyCreated(timeStampTTL, futureTimeToLive)) { throw new WSSecurityException( WSSecurityException.MESSAGE_EXPIRED,
Date created = receivedTimestamp.getCreated(); DateTime createdDateTime = new DateTime(created); Instant createdInstant = createdDateTime.toInstant();
&& WSConstants.TIMESTAMP_TOKEN_LN.equals(((Element)sibling).getLocalName()) && WSConstants.WSU_NS.equals(((Element)sibling).getNamespaceURI())) { timeStamp = new Timestamp((Element)sibling, requestData.getWssConfig().isWsiBSPCompliant()); break; Date created = timeStamp.getCreated(); DateFormat zulu = new XmlSchemaDateFormat(); String identifier = zulu.format(created) + "" + Arrays.hashCode(signatureValue) Date expires = timeStamp.getExpires(); if (expires != null) { Date rightNow = new Date();
/** * 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); }
if ((timeStampStrict && timeStamp.isExpired()) || !timeStamp.verifyCreated(timeStampTTL, futureTimeToLive)) { throw new WSSecurityException( WSSecurityException.MESSAGE_EXPIRED,
@Override public boolean equals(Object object) { if (!(object instanceof Timestamp)) { return false; } Timestamp timestamp = (Timestamp)object; if (!compare(timestamp.getCreated(), getCreated())) { return false; } if (!compare(timestamp.getExpires(), getExpires())) { return false; } return true; }
/** * Get the timestamp element generated during <code>prepare()</code>. */ public Element getElement() { if (ts == null) { return null; } return ts.getElement(); } }
/** * Get the id generated during <code>prepare()</code>. * * Returns the the value of wsu:Id attribute of this Timestamp. * * @return Return the wsu:Id of this token or null if * <code>prepareToken()</code> was not called before. */ public String getId() { if (ts == null) { return null; } return ts.getID(); }
/** * Prepends the Timestamp element to the elements already in the Security * header. * * The method can be called any time after <code>prepare()</code>. This * allows to insert the Timestamp element at any position in the Security * header. * * @param secHeader The security header that holds the Signature element. */ public void prependToHeader(WSSecHeader secHeader) { WSSecurityUtil.prependChildElement(secHeader.getSecurityHeader(), ts.getElement()); }
/** * Prepends the Timestamp element to the elements already in the Security * header. * * The method can be called any time after <code>prepare()</code>. This * allows to insert the Timestamp element at any position in the Security * header. * * @param secHeader The security header that holds the Signature element. */ public void prependToHeader(WSSecHeader secHeader) { WSSecurityUtil.prependChildElement(secHeader.getSecurityHeader(), ts.getElement()); }
public WSSecurityEngineResult(int act, Timestamp tstamp) { put(TAG_ACTION, Integer.valueOf(act)); put(TAG_TIMESTAMP, tstamp); put(TAG_VALIDATED_TOKEN, Boolean.FALSE); put(TAG_TOKEN_ELEMENT, tstamp.getElement()); }
public WSSecurityEngineResult(int act, Timestamp tstamp) { put(TAG_ACTION, Integer.valueOf(act)); put(TAG_TIMESTAMP, tstamp); put(TAG_VALIDATED_TOKEN, Boolean.FALSE); put(TAG_TOKEN_ELEMENT, tstamp.getElement()); }