File Coverage

blib/lib/Zonemaster/LDNS/RR/RRSIG.pm
Criterion Covered Total %
statement 10 10 100.0
branch n/a
condition n/a
subroutine 3 3 100.0
pod 2 2 100.0
total 15 15 100.0


line stmt bran cond sub pod time code
1             package Zonemaster::LDNS::RR::RRSIG;
2              
3 13     13   103 use parent 'Zonemaster::LDNS::RR';
  13         42  
  13         81  
4              
5             sub verify {
6 2     2 1 1364 my ( $self, $rrset, $keys ) = @_;
7 2         5 my $msg = '';
8              
9 2         325 return $self->verify_time( $rrset, $keys, time(), $msg );
10             }
11              
12             sub verify_str {
13 2     2 1 10 my ( $self, $rrset, $keys ) = @_;
14 2         5 my $msg = '';
15              
16 2         214 $self->verify_time( $rrset, $keys, time(), $msg );
17              
18 2         19 return $msg;
19             }
20              
21             1;
22              
23             =head1 NAME
24              
25             Zonemaster::LDNS::RR::RRSIG - Type RRSIG record
26              
27             =head1 DESCRIPTION
28              
29             A subclass of L, so it has all the methods of that class available in addition to the ones documented here.
30              
31             =head1 METHODS
32              
33             =over
34              
35             =item typecovered()
36              
37             Returns a string with the name of the RR type this signature covers.
38              
39             =item algorithm()
40              
41             Returns the algorithm number.
42              
43             =item labels()
44              
45             Returns the number of labels that was used to calculate the signature.
46              
47             =item origttl()
48              
49             Returns the original TTL value.
50              
51             =item expiration()
52              
53             Returns the expiration time, as a time_t.
54              
55             =item inception()
56              
57             Returns the inception time, as a time_t.
58              
59             =item keytag()
60              
61             Returns the keytag.
62              
63             =item signer()
64              
65             Returns the signer name.
66              
67             =item signature()
68              
69             Returns the cryptographic signture in binary form.
70              
71             =item verify($rrset_ref, $key_ref)
72              
73             Cryptographically verifies that the signature in this object matches the given RRset and at least one of the given keys. C<$rrset_ref> should be a
74             reference to an array of RR objects, and C<$key_ref> a reference to an array of L objects. This method simply returns a true
75             or false value, depending on the result och the check.
76              
77             =item verify_str($rrset_ref, $key_ref)
78              
79             Takes exactly the same arguments as L and performs the same action, but instead of true/false it returns a string describing the result.
80             In the case of a successful result the message will be "All OK". For negative results, the string will describe the reason the verification failed.
81              
82             =item verify_time($rrset_ref, $key_ref, $time, $msg)
83              
84             This is the XS method doing the work for the previous two methods. C<$rrset_ref> and C<$key_ref> are the same as for the other methods. C<$time> is
85             the C value for which the validation should be made (for the previous two methods it is set to the current computer time). C<$msg> should be
86             a writable scalar, and the string message describing the result will be but in it. The return value from the method is true/false.
87              
88             =back