The algorithm used by this key :
0 - no key present 1 - DSA key present 2 - RSA key present
# File lib/Dnsruby/resource/IPSECKEY.rb, line 53 def from_hash(hash) @precedence = hash[:precedence] @gateway_type = hash[:gateway_type] @algorithm = hash[:algorithm] @gateway = load_gateway_from_string(@gateway_type, hash[:gateway]) @public_key = hash[:public_key] end
# File lib/Dnsruby/resource/IPSECKEY.rb, line 88 def from_string(input) if (input.length > 0) split = input.split(" ") @precedence = split[0].to_i @gateway_type = split[1].to_i @algorithm = split[2].to_i @gateway = load_gateway_from_string(@gateway_type, split[3]) @public_key = public_key_from_string(split[4]) end end
# File lib/Dnsruby/resource/IPSECKEY.rb, line 61 def load_gateway_from_string(gateway_type, s) gateway = nil if (gateway_type == 0) gateway = nil elsif (gateway_type == 1) # Load IPv4 gateway gateway = IPv4.create(s) elsif (gateway_type == 2) # Load IPv6 gateway gateway = IPv6.create(s) else # Load gateway domain name gateway = Name.create(s) end return gateway end
Generated with the Darkfish Rdoc Generator 2.