public void validateTimestamp(Map context, String created,
String expires, long maxClockSkew, long freshnessLimit)
throws XWSSecurityException {
if (expiresBeforeCreated(created, expires)) {
XWSSecurityException xwsse = new XWSSecurityException("Message expired!");
log.log(Level.SEVERE, LogStringsMessages.WSS_0232_EXPIRED_MESSAGE());
throw newSOAPFaultException(
MessageConstants.WSU_MESSAGE_EXPIRED,
"Message expired!",
xwsse);
}
TimestampValidationCallback.UTCTimestampRequest request =
new TimestampValidationCallback.UTCTimestampRequest(
created,
expires,
maxClockSkew,
freshnessLimit);
TimestampValidationCallback timestampValidationCallback =
new TimestampValidationCallback(request);
if (!isDefaultHandler) {
ProcessingContext.copy(timestampValidationCallback.getRuntimeProperties(), context);
}
Callback[] callbacks = new Callback[]{timestampValidationCallback};
boolean unSupported = false;
try {
callbackHandler.handle(callbacks);
} catch (UnsupportedCallbackException e) {
unSupported = true;
} catch (Exception e) {
log.log(Level.SEVERE,LogStringsMessages.WSS_0229_FAILED_VALIDATING_TIME_STAMP(), e);
throw new XWSSecurityException(e);
}
if (unSupported) {
//System.out.println("Validate Timestamp ...");
defaultValidateCreationTime(created, maxClockSkew, freshnessLimit);