Class: DNS::Zone::RR::DNSKEY
Overview
‘DNSKEY` resource record.
RFC 4034
Direct Known Subclasses
Constant Summary collapse
- REGEX_DNSKEY_RDATA =
%r{ (?<flags>\d+)\s* (?<protocol>\d+)\s* (?<algorithm>\d+)\s* (?<key>#{DNS::Zone::RR::REGEX_STRING})\s* }mx
Instance Attribute Summary collapse
-
#algorithm ⇒ Object
Returns the value of attribute algorithm.
-
#flags ⇒ Object
Returns the value of attribute flags.
-
#key ⇒ Object
Returns the value of attribute key.
-
#protocol ⇒ Object
Returns the value of attribute protocol.
Attributes inherited from Record
Instance Method Summary collapse
Methods inherited from Record
#general_prefix, #initialize, #load_general_and_get_rdata, #type
Constructor Details
This class inherits a constructor from DNS::Zone::RR::Record
Instance Attribute Details
#algorithm ⇒ Object
Returns the value of attribute algorithm.
13 14 15 |
# File 'lib/dns/zone/rr/dnskey.rb', line 13 def algorithm @algorithm end |
#flags ⇒ Object
Returns the value of attribute flags.
13 14 15 |
# File 'lib/dns/zone/rr/dnskey.rb', line 13 def flags @flags end |
#key ⇒ Object
Returns the value of attribute key.
13 14 15 |
# File 'lib/dns/zone/rr/dnskey.rb', line 13 def key @key end |
#protocol ⇒ Object
Returns the value of attribute protocol.
13 14 15 |
# File 'lib/dns/zone/rr/dnskey.rb', line 13 def protocol @protocol end |
Instance Method Details
#dump ⇒ Object
15 16 17 18 19 20 21 22 |
# File 'lib/dns/zone/rr/dnskey.rb', line 15 def dump parts = general_prefix parts << flags parts << protocol parts << algorithm parts << key parts.join(' ') end |
#load(string, options = {}) ⇒ Object
24 25 26 27 28 29 30 31 32 33 34 35 36 |
# File 'lib/dns/zone/rr/dnskey.rb', line 24 def load(string, = {}) rdata = load_general_and_get_rdata(string, ) return nil unless rdata captures = rdata.match(REGEX_DNSKEY_RDATA) return nil unless captures @flags = captures[:flags].to_i @protocol = captures[:protocol].to_i @algorithm = captures[:algorithm].to_i @key = captures[:key].scan(/#{DNS::Zone::RR::REGEX_STRING}/).join self end |