function rr_rdata($packet, $offset)
 {
     $rdata = '';
     $sigdata = '';
     if (strlen($this->key)) {
         $key = $this->key;
         $key = ereg_replace(' ', '', $key);
         $key = base64_decode($key);
         $newpacket = $packet;
         $newoffset = $offset;
         array_pop($newpacket->additional);
         $newpacket->header->arcount--;
         $newpacket->compnames = array();
         /*
          * Add the request MAC if present (used to validate responses).
          */
         if (isset($this->request_mac)) {
             $sigdata .= pack('H*', $this->request_mac);
         }
         $sigdata .= $newpacket->data();
         /*
          * Don't compress the record (key) name.
          */
         $tmppacket = new Net_DNS_Packet();
         $sigdata .= $tmppacket->dn_comp(strtolower($this->name), 0);
         $sigdata .= pack('n', Net_DNS::classesbyname(strtoupper($this->class)));
         $sigdata .= pack('N', $this->ttl);
         /*
          * Don't compress the algorithm name.
          */
         $tmppacket->compnames = array();
         $sigdata .= $tmppacket->dn_comp(strtolower($this->algorithm), 0);
         $sigdata .= pack('nN', 0, $this->time_signed);
         $sigdata .= pack('n', $this->fudge);
         $sigdata .= pack('nn', $this->error, $this->other_len);
         if (strlen($this->other_data)) {
             $sigdata .= pack('nN', 0, $this->other_data);
         }
         $this->mac = mhash(MHASH_MD5, $sigdata, $key);
         $this->mac_size = strlen($this->mac);
         /*
          * Don't compress the algorithm name.
          */
         unset($tmppacket);
         $tmppacket = new Net_DNS_Packet();
         $rdata .= $tmppacket->dn_comp(strtolower($this->algorithm), 0);
         $rdata .= pack('nN', 0, $this->time_signed);
         $rdata .= pack('nn', $this->fudge, $this->mac_size);
         $rdata .= $this->mac;
         $rdata .= pack('nnn', $packet->header->id, $this->error, $this->other_len);
         if ($this->other_data) {
             $rdata .= pack('nN', 0, $this->other_data);
         }
     }
     return $rdata;
 }