Class: DNS::Zone::RR::SSHFP
Overview
‘SSHFP` resource record.
RFC 4255
Constant Summary collapse
- REGEX_SSHFP_RDATA =
%r{ (?<algorithm_number>\d+)\s* (?<fingerprint_type>\d+)\s* (?<fingerprint>#{DNS::Zone::RR::REGEX_STRING})\s* }mx
Instance Attribute Summary collapse
-
#algorithm_number ⇒ Object
Returns the value of attribute algorithm_number.
-
#fingerprint ⇒ Object
Returns the value of attribute fingerprint.
-
#fingerprint_type ⇒ Object
Returns the value of attribute fingerprint_type.
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_number ⇒ Object
Returns the value of attribute algorithm_number.
12 13 14 |
# File 'lib/dns/zone/rr/sshfp.rb', line 12 def algorithm_number @algorithm_number end |
#fingerprint ⇒ Object
Returns the value of attribute fingerprint.
12 13 14 |
# File 'lib/dns/zone/rr/sshfp.rb', line 12 def fingerprint @fingerprint end |
#fingerprint_type ⇒ Object
Returns the value of attribute fingerprint_type.
12 13 14 |
# File 'lib/dns/zone/rr/sshfp.rb', line 12 def fingerprint_type @fingerprint_type end |
Instance Method Details
#dump ⇒ Object
14 15 16 17 18 19 20 |
# File 'lib/dns/zone/rr/sshfp.rb', line 14 def dump parts = general_prefix parts << algorithm_number parts << fingerprint_type parts << fingerprint parts.join(' ') end |
#load(string, options = {}) ⇒ Object
22 23 24 25 26 27 28 29 30 31 32 33 |
# File 'lib/dns/zone/rr/sshfp.rb', line 22 def load(string, = {}) rdata = load_general_and_get_rdata(string, ) return nil unless rdata captures = rdata.match(REGEX_SSHFP_RDATA) return nil unless captures @algorithm_number = captures[:algorithm_number].to_i @fingerprint_type = captures[:fingerprint_type].to_i @fingerprint = captures[:fingerprint] self end |