class KRB5::Entry

Attributes

bytes[RW]

Place to store byte array for to_bytes @return [Sting, nil]

enctype[RW]
key[RW]
keytab[RW]

@return [KRB5::Keytab]

kvno32[RW]
kvno8[RW]
principal[RW]
timestamp[RW]

Public Class Methods

new(keytab) click to toggle source
# File lib/krb5/entry.rb, line 21
def initialize(keytab)
  @keytab = keytab
end

Public Instance Methods

==(other) click to toggle source
# File lib/krb5/entry.rb, line 52
def ==(other)
  %i[principal timestamp kvno8 enctype key kvno32].each do |state|
    return false unless other.send(state) == self.send(state)
  end

  true
end
kvno() click to toggle source

The 32-bit key version overrides the 8-bit key version. @return [Integer] key version number

# File lib/krb5/entry.rb, line 27
def kvno
  kvno32 ? kvno32 : kvno8
end
to_bytes() click to toggle source

entry ::=

principal
timestamp (32 bits)
key version (8 bits)
enctype (16 bits)
key length (16 bits)
key contents
key version (32 bits) [in release 1.14 and later]
# File lib/krb5/entry.rb, line 39
def to_bytes
  @bytes = []

  pack_bytes(principal.to_bytes)
  pack_int32(timestamp.strftime('%s').to_i)
  pack_int8(kvno8)
  pack_int16(enctype)
  pack_data(key)
  pack_int32(kvno32) if kvno32

  @bytes.join
end