Class: Dnsruby::RR::TKEY

### Home Classes Methods

### In Files

- lib/Dnsruby/resource/TKEY.rb

### Parent

Dnsruby::RR

### Methods

- ::new
- #from_hash
- #other_data=
- #rdata_to_string

### Files

- DNSSEC
- EVENTMACHINE
- EXAMPLES
- README

### Class/Module Index

Quicksearch

- Dnsruby
- Dnsruby::Algorithms
- Dnsruby::Classes
- Dnsruby::CodeMapper
- Dnsruby::Config
- Dnsruby::DNS
- Dnsruby::DecodeError
- Dnsruby::Dnssec
- Dnsruby::Dnssec::ValidationPolicy
- Dnsruby::EncodeError
- Dnsruby::ExtendedRCode
- Dnsruby::FormErr
- Dnsruby::Header
- Dnsruby::Hosts
- Dnsruby::IPv4
- Dnsruby::IPv6
- Dnsruby::Message
- Dnsruby::Message::Section
- Dnsruby::Message::SecurityLevel
- Dnsruby::MetaTypes
- Dnsruby::Modes
- Dnsruby::NXDomain
- Dnsruby::NXRRSet
- Dnsruby::Name
- Dnsruby::Name::Label
- Dnsruby::NotAuth
- Dnsruby::NotImp
- Dnsruby::NotZone
- Dnsruby::Nsec3HashAlgorithms
- Dnsruby::OpCode
- Dnsruby::OtherResolvError
- Dnsruby::QTypes
- Dnsruby::Question
- Dnsruby::RCode
- Dnsruby::RR
- Dnsruby::RR::ANY
- Dnsruby::RR::CERT
- Dnsruby::RR::CERT::CertificateTypes
- Dnsruby::RR::CNAME
- Dnsruby::RR::DHCID
- Dnsruby::RR::DLV
- Dnsruby::RR::DNAME
- Dnsruby::RR::DNSKEY
- Dnsruby::RR::DS
- Dnsruby::RR::DS::DigestTypes
- Dnsruby::RR::DomainName
- Dnsruby::RR::Generic
- Dnsruby::RR::HINFO
- Dnsruby::RR::HIP
- Dnsruby::RR::IN
- Dnsruby::RR::IN::A
- Dnsruby::RR::IN::AAAA
- Dnsruby::RR::IN::AFSDB
- Dnsruby::RR::IN::PX
- Dnsruby::RR::IN::SRV
- Dnsruby::RR::IN::WKS
- Dnsruby::RR::IPSECKEY
- Dnsruby::RR::ISDN
- Dnsruby::RR::KX
- Dnsruby::RR::LOC
- Dnsruby::RR::MB
- Dnsruby::RR::MG
- Dnsruby::RR::MINFO
- Dnsruby::RR::MR
- Dnsruby::RR::MX
- Dnsruby::RR::NAPTR
- Dnsruby::RR::NS
- Dnsruby::RR::NSAP
- Dnsruby::RR::NSEC
- Dnsruby::RR::NSEC3
- Dnsruby::RR::NSEC3PARAM
- Dnsruby::RR::OPT
- Dnsruby::RR::PTR
- Dnsruby::RR::RP
- Dnsruby::RR::RRSIG
- Dnsruby::RR::RT
- Dnsruby::RR::SOA
- Dnsruby::RR::SPF
- Dnsruby::RR::SSHFP
- Dnsruby::RR::SSHFP::Algorithms
- Dnsruby::RR::SSHFP::FpTypes
- Dnsruby::RR::TKEY
- Dnsruby::RR::TSIG
- Dnsruby::RR::TXT
- Dnsruby::RR::X25
- Dnsruby::RRSet
- Dnsruby::Recursor
- Dnsruby::Refused
- Dnsruby::Resolv
- Dnsruby::ResolvError
- Dnsruby::ResolvTimeout
- Dnsruby::Resolver
- Dnsruby::Resolver::EventType
- Dnsruby::SelectThread
- Dnsruby::ServFail
- Dnsruby::SingleResolver
- Dnsruby::TheLog
- Dnsruby::TsigError
- Dnsruby::TsigNotSignedResponseError
- Dnsruby::Types
- Dnsruby::Update
- Dnsruby::VerifyError
- Dnsruby::YXDomain
- Dnsruby::YXRRSet
- Dnsruby::ZoneReader
- Dnsruby::ZoneReader::ParseException
- Dnsruby::ZoneSerialError
- Dnsruby::ZoneTransfer
- Dnsruby::ZoneTransfer::Delta
- Base32

No matching classes.

# 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

    # 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

[Validate]

Generated with the Darkfish Rdoc Generator 2.