/**
  * Create a timestamp signature.
  *
  * @param string|SetaPDF_Core_Reader_FilePath $data
  * @return SetaPDF_Signer_Asn1_Element
  * @throws SetaPDF_Signer_Exception
  */
 public function createTimestamp($data)
 {
     $hash = $this->_getHash($data);
     $req = array('timestampingRequest' => array('ticket' => $this->getTicket(), 'data' => $hash));
     $client = new SoapClient($this->_wsdl, array_merge($this->_clientOptions, array('trace' => true)));
     $result = $client->timestampDigest($req);
     $this->_lastResult = $result;
     if ($result->return->result != 0) {
         throw new SetaPDF_Signer_Exception(sprintf('QuoVadis timestamp failed with result code %s.', $result->return->result));
     }
     $timestampToken = $result->return->timestampToken;
     if ($this->_collectVerificationData) {
         $req = array('verifyingRequest' => array('ticket' => $this->getTicket(), 'data' => $hash, 'signature' => $timestampToken));
         $verificationData = $client->verifyTimestamp($req)->return;
         if ($verificationData->result != 0) {
             throw new SetaPDF_Signer_Exception(sprintf('QuoVadis verifyTimestamp failed with result code %s.', $verificationData->result));
         }
         $this->_verificationData = $verificationData;
     }
     return $timestampToken;
 }