Class: Dnsruby::RR::NSEC3PARAM

### Home Classes Methods

### In Files

- lib/dnsruby/resource/NSEC3PARAM.rb

### Parent

Dnsruby::RR

### Methods

- #flags=
- #from_string
- #hash_alg=
- #salt
- #salt=
- #types=

### Files

- DNSSEC
- EVENTMACHINE
- EXAMPLES

### Class/Module Index

Quicksearch

- Dnsruby
- Dnsruby::Algorithms
- Dnsruby::BitMapping
- Dnsruby::Bitmap
- 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::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::GPOS
- 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::NXT
- Dnsruby::RR::NXT::NxtTypes
- Dnsruby::RR::NXT::TypeBitmap
- 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::Section
- Dnsruby::SelectThread
- Dnsruby::ServFail
- Dnsruby::SingleResolver
- Dnsruby::SocketEofResolvError
- 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
- Object

No matching classes.

# Dnsruby::RR::NSEC3PARAM

The NSEC3PARAM RR contains the NSEC3 parameters (hash algorithm, flags, iterations and salt) needed by authoritative servers to calculate hashed owner names. The presence of an NSEC3PARAM RR at a zone apex indicates that the specified parameters may be used by authoritative servers to choose an appropriate set of NSEC3 RRs for negative responses. The NSEC3PARAM RR is not used by validators or resolvers.

### Attributes

flags[R]

The Flags field contains 8 one-bit flags that can be used to indicate different processing. All undefined flags must be zero. The only flag defined by the NSEC3 specification is the Opt-Out flag.

hash_alg[R]

The Hash Algorithm field identifies the cryptographic hash algorithm used to construct the hash-value.

iterations[RW]

The Iterations field defines the number of additional times the hash function has been performed.

salt_length[R]

The Salt Length field defines the length of the Salt field in octets, ranging in value from 0 to 255.

### Public Instance Methods

flags=(f) click to toggle source

    # File lib/dnsruby/resource/NSEC3PARAM.rb, line 72
    def flags=(f)
      if (f==0 || f==1)
        @flags=f
      else
        raise DecodeError.new("Unknown NSEC3 flags field - #{f}")
      end
    end

from_string(input) click to toggle source

    # File lib/dnsruby/resource/NSEC3PARAM.rb, line 97
    def from_string(input)
      if (input.length > 0)
        data = input.split(" ")
        self.hash_alg=(data[0]).to_i
        self.flags=(data[1]).to_i
        self.iterations=(data[2]).to_i
        self.salt=(data[3])
        #           self.salt_length=(data[3].length)
      end
    end

hash_alg=(a) click to toggle source

    # File lib/dnsruby/resource/NSEC3PARAM.rb, line 54
    def hash_alg=(a)
      if (a.instance_of?String)
        if (a.length == 1)
          a = a.to_i
        end
      end
      begin
        alg = Nsec3HashAlgorithms.new(a)
        @hash_alg = alg
      rescue ArgumentError => e
        raise DecodeError.new(e)
      end
    end

salt() click to toggle source

The Salt field is appended to the original owner name before hashing in order to defend against pre-calculated dictionary attacks.

    # File lib/dnsruby/resource/NSEC3PARAM.rb, line 45
    def salt
      return NSEC3.encode_salt(@salt)
    end

salt=(s) click to toggle source

    # File lib/dnsruby/resource/NSEC3PARAM.rb, line 49
    def salt=(s)
      @salt = NSEC3.decode_salt(s)
      @salt_length = @salt.length
    end

types=(t) click to toggle source

    # File lib/dnsruby/resource/NSEC3PARAM.rb, line 68
    def types=(t)
      @types = NSEC.get_types(t)
    end

[Validate]

Generated with the Darkfish Rdoc Generator 2.