class Dnsruby::RR::TKEY

RFC2930

Attributes

algorithm[RW]

Gets or sets the domain name that specifies the name of the algorithm. The default algorithm is gss.microsoft.com

rr.algorithm=(algorithm_name)
print "algorithm = ", rr.algorithm, "\n"
error[RW]

Returns the RCODE covering TKEY processing. See RFC 2930 for details.

print "error = ", rr.error, "\n"
expiration[RW]

Gets or sets the expiration time as the number of seconds since 1 Jan 1970 00:00:00 UTC.

The default expiration time is the current time plus 1 day.

rr.expiration=(time)
print "expiration = ", rr.expiration, "\n"
inception[RW]

Gets or sets the inception time as the number of seconds since 1 Jan 1970 00:00:00 UTC.

The default inception time is the current time.

rr.inception=(time)
print "inception = ", rr.inception, "\n"
key[RW]
key_size[R]
mode[RW]

Sets the key mode (see rfc2930). The default is 3 which corresponds to GSSAPI

rr.mode=(3)
print "mode = ", rr.mode, "\n"
other_data[R]

Returns the Other Data. This field should be empty.

print "other data = ", rr.other_data, "\n"
other_size[R]

Returns the length of the Other Data. Should be zero.

print "other size = ", rr.other_size, "\n"

Public Class Methods

new() click to toggle source
# File lib/dnsruby/resource/TKEY.rb, line 97
def initialize
  @algorithm   = "gss.microsoft.com"
  @inception   = Time.now
  @expiration  = Time.now + 24*60*60
  @mode        = Modes.GSSAPI
  @error       = 0
  @other_size   = 0
  @other_data  = ""

  #  RFC 2845 Section 2.3
  @klass = Classes.ANY
  #  RFC 2845 Section 2.3
  @ttl = 0
end

Public Instance Methods

from_hash(hash) click to toggle source
Calls superclass method
# File lib/dnsruby/resource/TKEY.rb, line 112
def from_hash(hash)
  super(hash)
  if (algorithm)
  @algorithm = Name.create(hash[:algorithm])
  end
end
other_data=(od) click to toggle source
# File lib/dnsruby/resource/TKEY.rb, line 92
def other_data=(od)
  @other_data=od
  @other_size=@other_data.length
end
rdata_to_string() click to toggle source
# File lib/dnsruby/resource/TKEY.rb, line 128
def rdata_to_string
  rdatastr=""

  if (@algorithm!=nil)
    error = @error
    error = "UNDEFINED" unless error!=nil
    rdatastr = "#{@algorithm.to_s(true)} #{error}"
    if (@other_size != nil && @other_size >0 && @other_data!=nil)
      rdatastr += " #{@other_data}"
    end
  end

  return rdatastr
end