public void addSignatureTimestamp(byte[] timestampDer) throws Exception {
  Element unsignedProperties=getFirstElementByTagName(document,xadesElement(UNSIGNED_SIGNATURE_PROPS_TAG));
  Element signatureTimeStampElement=document.createElement(xadesElement(SIGNATURE_TIMESTAMP_TAG));
  String timestampDERBase64=encodeBase64(timestampDer);
  signatureTimeStampElement.setTextContent(timestampDERBase64);
  unsignedProperties.insertBefore(signatureTimeStampElement,unsignedProperties.getFirstChild());
}

public void addSignatureTimestamp ( byte [ ] timestampDer ) throws Exception { Element unsignedProperties = getFirstElementByTagName ( document , xadesElement ( UNSIGNED_SIGNATURE_PROPS_TAG ) ) ; Element signatureTimeStampElement = document . createElement ( xadesElement ( SIGNATURE_TIMESTAMP_TAG ) ) ; String timestampDERBase64 = encodeBase64 ( timestampDer ) ; signatureTimeStampElement . setTextContent ( timestampDERBase64 ) ; unsignedProperties . insertBefore ( signatureTimeStampElement , unsignedProperties . getFirstChild ( ) ) ; }
adds the signaturetimestamp element containing the base64 encoded timestamp der .
