for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
/*
* This file is part of Badcow DNS Library.
*
* (c) Samuel Williams <[email protected]>
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace Badcow\DNS\Rdata\DNSSEC;
use Badcow\DNS\Rdata\RdataInterface;
use Badcow\DNS\Rdata\RdataTrait;
class DsRdata implements RdataInterface
{
use RdataTrait;
const TYPE = 'DS';
const DIGEST_SHA1 = 1;
/**
* @var int
private $keyTag;
* The Algorithm field lists the algorithm number of the DNSKEY RR
* referred to by the DS record.
* {@link https://tools.ietf.org/html/rfc4034#section-5.1.2}
private $algorithm;
private $digestType = self::DIGEST_SHA1;
* @var string
private $digest;
* @return int
public function getKeyTag()
return $this->keyTag;
}
* @param int $keyTag
public function setKeyTag($keyTag)
$this->keyTag = (int) $keyTag;
public function getAlgorithm()
return $this->algorithm;
* @param int $algorithm
public function setAlgorithm($algorithm)
$this->algorithm = (int) $algorithm;
public function getDigestType()
return $this->digestType;
* @param int $digestType
public function setDigestType($digestType)
$this->digestType = (int) $digestType;
* @return string
public function getDigest()
return $this->digest;
* @param string $digest
public function setDigest($digest)
$this->digest = $digest;
* {@inheritdoc}
public function output()
return sprintf(
'%s %s %s %s',
$this->keyTag,
$this->algorithm,
$this->digestType,
$this->digest
);