44namespace ArrayAccess \DnsRecord \ResourceRecord \RRTypes ;
55
66use ArrayAccess \DnsRecord \Abstracts \AbstractResourceRecordType ;
7+ use ArrayAccess \DnsRecord \Interfaces \ResourceRecord \ResourceRecordQTypeDefinitionInterface ;
8+ use ArrayAccess \DnsRecord \ResourceRecord \Definitions \QType ;
79use ArrayAccess \DnsRecord \Utils \Buffer ;
810use function base64_encode ;
911use function is_array ;
@@ -14,17 +16,17 @@ class RRSIG extends AbstractResourceRecordType
1416{
1517 const TYPE = 'RRSIG ' ;
1618
17- protected int $ sigType ;
19+ protected ResourceRecordQTypeDefinitionInterface $ sigType ;
1820
1921 protected int $ algorithm ;
2022
2123 protected int $ labels ;
2224
2325 protected int $ originalttl ;
2426
25- protected int $ expiration ;
27+ protected string $ expiration ;
2628
27- protected int $ inception ;
29+ protected string $ inception ;
2830
2931 protected int $ keyTag ;
3032
@@ -44,22 +46,25 @@ protected function parseRData(string $message, int $rdataOffset): void
4446 );
4547 if (is_array ($ stuff )) {
4648 [
47- 'type ' => $ this -> sigType ,
49+ 'type ' => $ sigType ,
4850 'algorithm ' => $ this ->algorithm ,
4951 'labels ' => $ this ->labels ,
5052 'originalttl ' => $ this ->originalttl ,
51- 'expiration ' => $ this -> expiration ,
52- 'inception ' => $ this -> inception ,
53+ 'expiration ' => $ expiration ,
54+ 'inception ' => $ inception ,
5355 'keytag ' => $ this ->keyTag ,
5456 ] = $ stuff ;
57+ $ this ->sigType = QType::create ($ sigType );
58+ $ this ->inception = date ('YmdHis ' , $ inception );
59+ $ this ->expiration = date ('YmdHis ' , $ expiration );
5560 }
5661 $ this ->signer = Buffer::readLabel ($ message , $ rdataOffset );
5762 $ this ->signature = base64_encode (
5863 Buffer::read ($ message , $ rdataOffset , $ this ->rdLength - (strlen ($ this ->signer ) + 2 ) - 18 )
5964 );
6065 }
6166
62- public function getSigType (): int
67+ public function getSigType (): ResourceRecordQTypeDefinitionInterface
6368 {
6469 return $ this ->sigType ;
6570 }
@@ -79,12 +84,12 @@ public function getOriginalttl(): int
7984 return $ this ->originalttl ;
8085 }
8186
82- public function getExpiration (): int
87+ public function getExpiration (): string
8388 {
8489 return $ this ->expiration ;
8590 }
8691
87- public function getInception (): int
92+ public function getInception (): string
8893 {
8994 return $ this ->inception ;
9095 }
@@ -103,6 +108,7 @@ public function getSignature(): string
103108 {
104109 return $ this ->signature ;
105110 }
111+
106112 public function toArray (): array
107113 {
108114 return [
@@ -111,8 +117,8 @@ public function toArray(): array
111117 'class ' => $ this ->getClass ()->getName (),
112118 'type ' => $ this ->getType ()->getName (),
113119 'labels ' => $ this ->getLabels (),
114- 'sigtype ' => $ this ->getSigType (),
115- 'originalttl ' => $ this ->getOriginalttl (),
120+ 'sigtype ' => $ this ->getSigType ()-> getName () ,
121+ 'original-ttl ' => $ this ->getOriginalttl (),
116122 'expiration ' => $ this ->getExpiration (),
117123 'inception ' => $ this ->getInception (),
118124 'keytag ' => $ this ->getKeyTag (),
0 commit comments