/** * 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. */ public void prepare() { ts = new Timestamp(precisionInMilliSeconds, getDocument(), wsTimeSource, timeToLive); String tsId = getIdAllocator().createId("TS-", ts); ts.setID(tsId); }
&& WSConstants.TIMESTAMP_TOKEN_LN.equals(sibling.getLocalName()) && WSConstants.WSU_NS.equals(sibling.getNamespaceURI())) { timeStamp = new Timestamp((Element)sibling, requestData.getBSPEnforcer()); break;
public List<WSSecurityEngineResult> handleToken( Element elem, RequestData data ) throws WSSecurityException { LOG.debug("Found Timestamp list element"); // // Decode Timestamp, add the found time (created/expiry) to result // Timestamp timestamp = new Timestamp(elem, data.getBSPEnforcer()); Credential credential = new Credential(); credential.setTimestamp(timestamp); WSSecurityEngineResult result = new WSSecurityEngineResult(WSConstants.TS, timestamp); String tokenId = timestamp.getID(); if (!"".equals(tokenId)) { result.put(WSSecurityEngineResult.TAG_ID, tokenId); } Validator validator = data.getValidator(WSConstants.TIMESTAMP); if (validator != null) { validator.validate(credential, data); result.put(WSSecurityEngineResult.TAG_VALIDATED_TOKEN, Boolean.TRUE); } data.getWsDocInfo().addTokenElement(elem); data.getWsDocInfo().addResult(result); return java.util.Collections.singletonList(result); }