private Element createExtensions() throws DOMException {
  Element extEle=doc.createElement(SAMLNames.EXTENSIONS);
  Element exportedOnEle=doc.createElement(SAMLNames.EXPORTEDON);
  TimeZone timeZone=TimeZone.getTimeZone(SAMLNames.UTC);
  Calendar cal=Calendar.getInstance(timeZone);
  Date curTime=cal.getTime();
  SimpleDateFormat df=new SimpleDateFormat(SAMLNames.DATE_FORMAT);
  df.setTimeZone(timeZone);
  Node textNode=doc.createTextNode(df.format(curTime));
  exportedOnEle.appendChild(textNode);
  extEle.appendChild(exportedOnEle);
  Element exportedByEle=doc.createElement(SAMLNames.EXPORTEDBY);
  Node valExpByNode=doc.createTextNode(SAMLNames.EXPORTEDBY_VAL);
  exportedByEle.appendChild(valExpByNode);
  extEle.appendChild(exportedByEle);
  return extEle;
}

private Element createExtensions ( ) throws DOMException { Element extEle = doc . createElement ( SAMLNames . EXTENSIONS ) ; Element exportedOnEle = doc . createElement ( SAMLNames . EXPORTEDON ) ; TimeZone timeZone = TimeZone . getTimeZone ( SAMLNames . UTC ) ; Calendar cal = Calendar . getInstance ( timeZone ) ; Date curTime = cal . getTime ( ) ; SimpleDateFormat df = new SimpleDateFormat ( SAMLNames . DATE_FORMAT ) ; df . setTimeZone ( timeZone ) ; Node textNode = doc . createTextNode ( df . format ( curTime ) ) ; exportedOnEle . appendChild ( textNode ) ; extEle . appendChild ( exportedOnEle ) ; Element exportedByEle = doc . createElement ( SAMLNames . EXPORTEDBY ) ; Node valExpByNode = doc . createTextNode ( SAMLNames . EXPORTEDBY_VAL ) ; exportedByEle . appendChild ( valExpByNode ) ; extEle . appendChild ( exportedByEle ) ; return extEle ; }
create extension element of entitydescriptor in dom .
