Package org.apache.ws.security.util

Examples of org.apache.ws.security.util.XmlSchemaDateFormat.format()


        log.debug("Timestamp created: "
            + zulu.format(timestamp.getCreated().getTime()));
      }
      if (timestamp.getExpires() != null) {
        log.debug("Timestamp expires: "
            + zulu.format(timestamp.getExpires().getTime()));
      }
    }

    // Validate whether the security semantics have expired
    Calendar rightNow = Calendar.getInstance();
View Full Code Here


        if (doDebug) {
      log.debug("Preparing to verify the timestamp");
      DateFormat zulu = new XmlSchemaDateFormat();
      log.debug("Validation of Timestamp: Current time is "
          + zulu.format(Calendar.getInstance().getTime()));
      log.debug("Validation of Timestamp: Valid creation is "
          + zulu.format(validCreation.getTime()));
      if (timestamp.getCreated() != null) {
        log.debug("Validation of Timestamp: Timestamp created is "
            + zulu.format(timestamp.getCreated().getTime()));
View Full Code Here

      log.debug("Preparing to verify the timestamp");
      DateFormat zulu = new XmlSchemaDateFormat();
      log.debug("Validation of Timestamp: Current time is "
          + zulu.format(Calendar.getInstance().getTime()));
      log.debug("Validation of Timestamp: Valid creation is "
          + zulu.format(validCreation.getTime()));
      if (timestamp.getCreated() != null) {
        log.debug("Validation of Timestamp: Timestamp created is "
            + zulu.format(timestamp.getCreated().getTime()));
      }
    }
View Full Code Here

          + zulu.format(Calendar.getInstance().getTime()));
      log.debug("Validation of Timestamp: Valid creation is "
          + zulu.format(validCreation.getTime()));
      if (timestamp.getCreated() != null) {
        log.debug("Validation of Timestamp: Timestamp created is "
            + zulu.format(timestamp.getCreated().getTime()));
      }
    }
        // Validate the time it took the message to travel
        // if (timestamp.getCreated().before(validCreation) ||
        // !timestamp.getCreated().equals(validCreation)) {
View Full Code Here

        XmlSchemaDateFormat fmt = new XmlSchemaDateFormat();
        writer.writeStartElement("wst", "Lifetime", namespace);
        writer.writeNamespace("wsu", WSConstants.WSU_NS);
        writer.writeStartElement("wsu", "Created", WSConstants.WSU_NS);
        writer.writeCharacters(fmt.format(creationTime));
        writer.writeEndElement();

        writer.writeStartElement("wsu", "Expires", WSConstants.WSU_NS);
        writer.writeCharacters(fmt.format(expirationTime));
        writer.writeEndElement();
View Full Code Here

        writer.writeStartElement("wsu", "Created", WSConstants.WSU_NS);
        writer.writeCharacters(fmt.format(creationTime));
        writer.writeEndElement();

        writer.writeStartElement("wsu", "Expires", WSConstants.WSU_NS);
        writer.writeCharacters(fmt.format(expirationTime));
        writer.writeEndElement();
        writer.writeEndElement();
    }

    protected void addAppliesTo(XMLStreamWriter writer, String appliesTo) throws XMLStreamException {
View Full Code Here

            Date creationTime = new Date();
            Date expirationTime = new Date();
            expirationTime.setTime(creationTime.getTime() + ttlMs);

            XmlSchemaDateFormat fmt = new XmlSchemaDateFormat();
            lifetime.setCreated(fmt.format(creationTime));
            lifetime.setExpires(fmt.format(expirationTime));

            providerParameters.getTokenRequirements().setLifetime(lifetime);
        }
View Full Code Here

            Date expirationTime = new Date();
            expirationTime.setTime(creationTime.getTime() + ttlMs);

            XmlSchemaDateFormat fmt = new XmlSchemaDateFormat();
            lifetime.setCreated(fmt.format(creationTime));
            lifetime.setExpires(fmt.format(expirationTime));

            providerParameters.getTokenRequirements().setLifetime(lifetime);
        }

        TokenProviderResponse providerResponse = samlTokenProvider.createToken(providerParameters);
View Full Code Here

    ) throws Exception {
        XmlSchemaDateFormat fmt = new XmlSchemaDateFormat();
        writer.writeStartElement(prefix, "Lifetime", namespace);
        writer.writeNamespace("wsu", WSConstants.WSU_NS);
        writer.writeStartElement("wsu", "Created", WSConstants.WSU_NS);
        writer.writeCharacters(fmt.format(created.getTime()));
        writer.writeEndElement();
       
        writer.writeStartElement("wsu", "Expires", WSConstants.WSU_NS);
        writer.writeCharacters(fmt.format(expires.getTime()));
        writer.writeEndElement();
View Full Code Here

        writer.writeStartElement("wsu", "Created", WSConstants.WSU_NS);
        writer.writeCharacters(fmt.format(created.getTime()));
        writer.writeEndElement();
       
        writer.writeStartElement("wsu", "Expires", WSConstants.WSU_NS);
        writer.writeCharacters(fmt.format(expires.getTime()));
        writer.writeEndElement();
        writer.writeEndElement();
    }

}
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.