// Set expected lifetime to Default max lifetime plus 1
long requestedLifetime = DefaultConditionsProvider.DEFAULT_MAX_LIFETIME + 1;
Date creationTime = new Date();
Date expirationTime = new Date();
expirationTime.setTime(creationTime.getTime() + (requestedLifetime * 1000L));
Lifetime lifetime = new Lifetime();
XmlSchemaDateFormat fmt = new XmlSchemaDateFormat();
lifetime.setCreated(fmt.format(creationTime));
lifetime.setExpires(fmt.format(expirationTime));
renewerParameters.getTokenRequirements().setLifetime(lifetime);
CallbackHandler callbackHandler = new PasswordCallbackHandler();
Crypto crypto = CryptoFactory.getInstance(getEncryptionProperties());
// Create token.