class Rex::Proto::Kerberos::CredentialCache::KeyBlock

This class provides a representation of a credential keys stored in the Kerberos Credential Cache.

Attributes

e_type[RW]

@!attribute e_type

@return [Fixnum]
key_type[RW]

@!attribute key_type

@return [Fixnum]
key_value[RW]

@!attribute key_value

@return [String]

Public Instance Methods

encode() click to toggle source

Encodes the Rex::Proto::Kerberos::CredentialCache::KeyBlock into an String

@return [String] encoded key

# File lib/rex/proto/kerberos/credential_cache/key_block.rb, line 22
def encode
  encoded = ''
  encoded << encode_key_type
  encoded << encode_e_type
  encoded << encode_key_value

  encoded
end

Private Instance Methods

encode_e_type() click to toggle source

Encodes the e_type field

@return [String]

# File lib/rex/proto/kerberos/credential_cache/key_block.rb, line 43
def encode_e_type
  [e_type].pack('n')
end
encode_key_type() click to toggle source

Encodes the key_type field

@return [String]

# File lib/rex/proto/kerberos/credential_cache/key_block.rb, line 36
def encode_key_type
  [key_type].pack('n')
end
encode_key_value() click to toggle source

Encodes the key_value field

@return [String]

# File lib/rex/proto/kerberos/credential_cache/key_block.rb, line 50
def encode_key_value
  encoded = ''
  encoded << [key_value.length].pack('n')
  encoded << key_value

  encoded
end