final Calendar cal = new GregorianCalendar();
synchronized (calendarFormatter) {
calendarFormatter.setTimeZone(cal.getTimeZone());
cal.setTimeInMillis(currentTime);
final AttributedDateTime created = new AttributedDateTime();
created.setValue(calendarFormatter.format(cal.getTime()));
final AttributedDateTime expires = new AttributedDateTime();
cal.setTimeInMillis(currentTime + lifespan);
expires.setValue(calendarFormatter.format(cal.getTime()));
final Lifetime lifetime = WSTrustElementFactory.newInstance(wstVer).createLifetime(created, expires);
return lifetime;
}