Parent

Class Index [+]

Quicksearch

Dnsruby::RR::HIP

Constants

TypeValue

Attributes

hit_length[RW]

An 8-bit length for the HIT field

pk_algorithm[RW]

The PK algorithm used :

 0 - no key present
 1 - DSA key present
 2 - RSA key present
pk_length[RW]

An 8-bit length for the Public Key field

rsvs[RW]

An array of Rendezvous Servers

Public Instance Methods

from_hash(hash) click to toggle source
    # File lib/Dnsruby/resource/HIP.rb, line 47
47:       def from_hash(hash)
48:         @rsvs=[]
49:         @hit_length = hash[:hit_length]
50:         @pk_algorithm = hash[:pk_algorithm]
51:         @pk_length = hash[:pk_length]
52:         @hit = hash[:hit]
53:         @public_key = hash[:public_key]
54:         if (hash[:rsvs])
55:           hash[:rsvs].each {|rsv|
56:             @rsvs.push(Name.create(rsv))
57:           }
58:         end
59:       end
from_string(input) click to toggle source
     # File lib/Dnsruby/resource/HIP.rb, line 84
 84:       def from_string(input)
 85:         @rsvs=[]
 86:         if (input.length > 0)
 87:           split = input.split(" ")
 88: 
 89:           @pk_algorithm = split[0].to_i
 90:           @hit = hit_from_string(split[1])
 91:           @hit_length = @hit.length
 92:           @public_key = public_key_from_string(split[2])
 93:           @pk_length = @public_key.length
 94: 
 95:           # Now load in any RSVs there may be
 96:           count = 3
 97:           while (split[count])
 98:             @rsvs.push(Name.create(split[count]))
 99:             count += 1
100:           end
101: 
102:         end
103:       end
hit_from_string(hit_text) click to toggle source
    # File lib/Dnsruby/resource/HIP.rb, line 66
66:       def hit_from_string(hit_text)
67:         # Decode the hex value
68:         hit_text.gsub!(/\n/, "")
69:         hit_text.gsub!(/ /, "")
70:         return hit_text.unpack("H*")[0]
71:       end
hit_string() click to toggle source

HIT field - stored in binary : client methods should handle base16(hex) encoding

    # File lib/Dnsruby/resource/HIP.rb, line 62
62:       def hit_string
63:         # Return hex value
64:         [@hit.to_s].pack("H*").gsub("\n", "")
65:       end
public_key_from_string(key_text) click to toggle source
    # File lib/Dnsruby/resource/HIP.rb, line 78
78:       def public_key_from_string(key_text)
79:         key_text.gsub!(/\n/, "")
80:         key_text.gsub!(/ /, "")
81:         return key_text.unpack("m*")[0]
82:       end
public_key_string() click to toggle source

Public Key field - presentation format is base64 - public_key methods reused from IPSECKEY

    # File lib/Dnsruby/resource/HIP.rb, line 74
74:       def public_key_string
75:         [@public_key.to_s].pack("m*").gsub("\n", "")
76:       end

Disabled; run with --debug to generate this.

[Validate]

Generated with the Darkfish Rdoc Generator 1.1.6.