public function getKeydata() { // Check if dnssec is enabled on this interface if ($this->findNamespace('secDNS')) { $xpath = $this->xPath(); $result = $xpath->query('/epp:epp/epp:response/epp:extension/secDNS:infData/*'); $keys = array(); if (count($result) > 0) { foreach ($result as $keydata) { $secdns = new eppSecdns(); $secdns->setKeytag($result->item(0)->getElementsByTagName('keyTag')->item(0)->nodeValue); $secdns->setAlgorithm($result->item(0)->getElementsByTagName('alg')->item(0)->nodeValue); $secdns->setDigestType($result->item(0)->getElementsByTagName('digestType')->item(0)->nodeValue); $secdns->setDigest($result->item(0)->getElementsByTagName('digest')->item(0)->nodeValue); $keys[] = $secdns; } } return $keys; } return null; }
/** * * @param eppDomain $domain * @return \domElement */ public function setDomain(eppDomain $domain) { if (!strlen($domain->getDomainname())) { throw new eppException('No valid domain name in create domain request'); } if (!strlen($domain->getRegistrant())) { throw new eppException('No valid registrant in create domain request'); } # # Object create structure # $create = $this->createElement('create'); $this->domainobject = $this->createElement('domain:create'); $this->domainobject->appendChild($this->createElement('domain:name', $domain->getDomainname())); if ($domain->getPeriod() > 0) { $domainperiod = $this->createElement('domain:period', $domain->getPeriod()); $domainperiod->setAttribute('unit', $domain->getPeriodUnit()); $this->domainobject->appendChild($domainperiod); } $nsobjects = $domain->getHosts(); if ($domain->getHostLength() > 0) { $nameservers = $this->createElement('domain:ns'); foreach ($nsobjects as $nsobject) { if ($this->forcehostattr || $nsobject->getIpAddressCount() > 0) { $nameservers->appendChild($this->addDomainHostAttr($nsobject)); } else { $nameservers->appendChild($this->addDomainHostObj($nsobject)); } } $this->domainobject->appendChild($nameservers); } $this->domainobject->appendChild($this->createElement('domain:registrant', $domain->getRegistrant())); $contacts = $domain->getContacts(); if ($domain->getContactLength() > 0) { foreach ($contacts as $contact) { $this->addDomainContact($this->domainobject, $contact->getContactHandle(), $contact->getContactType()); } } if (strlen($domain->getAuthorisationCode())) { $authinfo = $this->createElement('domain:authInfo'); $authinfo->appendChild($this->createElement('domain:pw', $domain->getAuthorisationCode())); $this->domainobject->appendChild($authinfo); } $create->appendChild($this->domainobject); $this->getCommand()->appendChild($create); // Check for DNSSEC keys and add them if ($domain->getSecdnsLength() > 0) { for ($i = 0; $i < $domain->getSecdnsLength(); $i++) { $sd = $domain->getSecdns($i); /* @var $sd eppSecdns */ if ($sd) { $ext = new eppSecdns(); $ext->copy($sd); $this->addSecdns($ext); } } } return; }
public function getKeydata() { // Check if dnssec is enabled on this interface if ($this->findNamespace('secDNS')) { $xpath = $this->xPath(); $result = $xpath->query('/epp:epp/epp:response/epp:extension/secDNS:infData/*'); $keys = array(); if ($result->length > 0) { foreach ($result as $keydata) { /* @var $keydata \DOMElement */ $secdns = new eppSecdns(); $secdns->setFlags($keydata->getElementsByTagName('flags')->item(0)->nodeValue); $secdns->setAlgorithm($keydata->getElementsByTagName('alg')->item(0)->nodeValue); $secdns->setProtocol($keydata->getElementsByTagName('protocol')->item(0)->nodeValue); $secdns->setPubkey($keydata->getElementsByTagName('pubKey')->item(0)->nodeValue); $keys[] = $secdns; } } return $keys; } return null; }