123456789_123456789_123456789_123456789_123456789_

Class: Resolv::DNS::Resource::CAA

Relationships & Source Files
Super Chains via Extension / Inclusion / Inheritance
Class Chain:
Instance Chain:
Inherits: Resolv::DNS::Resource
Defined in: lib/resolv.rb

Overview

CAA resource record defined in RFC 8659

These records identify certificate authority allowed to issue certificates for the given domain.

Constant Summary

::Resolv::DNS::Resource - Inherited

ClassHash, ClassInsensitiveTypes, ClassValue

Class Method Summary

Instance Attribute Summary

  • #critical? ⇒ Boolean readonly

    Whether the critical flag is set on this property.

  • #flags readonly

    Flags for this proprty: - Bit 0 : 0 = not critical, 1 = critical.

  • #tag readonly

    Property tag (“issue”, “issuewild”, “iodef”…).

  • #value readonly

    Property value.

::Resolv::DNS::Resource - Inherited

#ttl

Remaining Time To Live for this ::Resolv::DNS::Resource.

Instance Method Summary

Constructor Details

.new(flags, tag, value) ⇒ CAA

Creates a new CAA for #flags, #tag and #value.

[ GitHub ]

  
# File 'lib/resolv.rb', line 2552

def initialize(flags, tag, value)
  unless (0..255) === flags
    raise ArgumentError.new('flags must be an Integer between 0 and 255')
  end
  unless (1..15) === tag.bytesize
    raise ArgumentError.new('length of tag must be between 1 and 15')
  end

  @flags = flags
  @tag = tag
  @value = value
end

Class Method Details

.decode_rdata(msg)

This method is for internal use only.
[ GitHub ]

  
# File 'lib/resolv.rb', line 2594

def self.decode_rdata(msg) # :nodoc:
  flags, = msg.get_unpack('C')
  tag = msg.get_string
  value = msg.get_bytes
  self.new flags, tag, value
end

Instance Attribute Details

#critical?Boolean (readonly)

Whether the critical flag is set on this property.

[ GitHub ]

  
# File 'lib/resolv.rb', line 2584

def critical?
  flags & 0x80 != 0
end

#flags (readonly)

Flags for this proprty:

  • Bit 0 : 0 = not critical, 1 = critical

[ GitHub ]

  
# File 'lib/resolv.rb', line 2569

attr_reader :flags

#tag (readonly)

Property tag (“issue”, “issuewild”, “iodef”…).

[ GitHub ]

  
# File 'lib/resolv.rb', line 2574

attr_reader :tag

#value (readonly)

Property value.

[ GitHub ]

  
# File 'lib/resolv.rb', line 2579

attr_reader :value

Instance Method Details

#encode_rdata(msg)

This method is for internal use only.
[ GitHub ]

  
# File 'lib/resolv.rb', line 2588

def encode_rdata(msg) # :nodoc:
  msg.put_pack('C', @flags)
  msg.put_string(@tag)
  msg.put_bytes(@value)
end