Class | Dnsruby::RR::TKEY |
In: |
lib/Dnsruby/resource/TKEY.rb
|
Parent: | RR |
RFC2930
TypeValue | = | Types::TKEY #:nodoc: all |
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" |
# File lib/Dnsruby/resource/TKEY.rb, line 97 97: def initialize 98: @algorithm = "gss.microsoft.com" 99: @inception = Time.now 100: @expiration = Time.now + 24*60*60 101: @mode = Modes.GSSAPI 102: @error = 0 103: @other_size = 0 104: @other_data = "" 105: 106: # RFC 2845 Section 2.3 107: @klass = Classes.ANY 108: # RFC 2845 Section 2.3 109: @ttl = 0 110: end
# File lib/Dnsruby/resource/TKEY.rb, line 112 112: def from_hash(hash) 113: super(hash) 114: if (algorithm) 115: @algorithm = Name.create(hash[:algorithm]) 116: end 117: end
# File lib/Dnsruby/resource/TKEY.rb, line 92 92: def other_data=(od) 93: @other_data=od 94: @other_size=@other_data.length 95: end
# File lib/Dnsruby/resource/TKEY.rb, line 128 128: def rdata_to_string 129: rdatastr="" 130: 131: if (@algorithm!=nil) 132: error = @error 133: error = "UNDEFINED" unless error!=nil 134: rdatastr = "#{@algorithm.to_s(true)} #{error}" 135: if (@other_size != nil && @other_size >0 && @other_data!=nil) 136: rdatastr += " #{@other_data}" 137: end 138: end 139: 140: return rdatastr 141: end