Class PKIMessageGenerateUtils


  • public class PKIMessageGenerateUtils
    extends java.lang.Object
    Class containing help utils when populating data in messages.
    • Field Summary

      Fields 
      Modifier and Type Field Description
      protected static char[] hexArray  
    • Method Summary

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method Description
      static java.lang.String bytesToHex​(byte[] bytes)  
      static javax.xml.datatype.XMLGregorianCalendar dateToXMLGregorianCalendar​(java.util.Date date)
      Method to convert a date to a XML gregorian calendar
      static java.lang.String generateRandomUUID()
      Help method to generate a unique UUID according the the message header specification
      static java.util.Date xMLGregorianCalendarToDate​(javax.xml.datatype.XMLGregorianCalendar calendarDate)
      Method to convert a XML gregorian calendar to a date
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Field Detail

      • hexArray

        protected static final char[] hexArray
    • Constructor Detail

      • PKIMessageGenerateUtils

        public PKIMessageGenerateUtils()
    • Method Detail

      • generateRandomUUID

        public static java.lang.String generateRandomUUID()
        Help method to generate a unique UUID according the the message header specification

        Pattern: [0-9a-fA-F]{8}-[0-9a-fA-F]{4}-4[0-9a-fA-F]{3}-[8-9a-bA-B][0-9a-fA-F]{3}-[0-9a-fA-F]{12}

        Returns:
        a newly generated UUID
      • dateToXMLGregorianCalendar

        public static javax.xml.datatype.XMLGregorianCalendar dateToXMLGregorianCalendar​(java.util.Date date)
                                                                                  throws MessageException
        Method to convert a date to a XML gregorian calendar
        Parameters:
        date - the date to convert
        Returns:
        a XMLGregorianCalendar object or null if date is null.
        Throws:
        MessageException - if internal problems occurred converting the date.
      • xMLGregorianCalendarToDate

        public static java.util.Date xMLGregorianCalendarToDate​(javax.xml.datatype.XMLGregorianCalendar calendarDate)
                                                         throws MessageException
        Method to convert a XML gregorian calendar to a date
        Parameters:
        calendarDate - the date to convert
        Returns:
        a Date object or null if calendarDate is null.
        Throws:
        MessageException - if internal problems occurred converting the date.
      • bytesToHex

        public static java.lang.String bytesToHex​(byte[] bytes)