Class: Rex::Proto::Kerberos::Model::PreAuthEtypeInfo2

Inherits:
Element
  • Object
show all
Defined in:
lib/rex/proto/kerberos/model/pre_auth_etype_info2.rb

Overview

This class provides a representation of a PA-Etype-Info2 structure, which contains information about valid encryption types and salts that can be used to authenticate using Kerberos Pre-Authentication

Constant Summary

Constants included from Rex::Proto::Kerberos::Model

AP_REP, AP_REQ, AS_REP, AS_REQ, AUTHENTICATOR, ENC_AP_REP_PART, ENC_KRB_CRED_PART, KRB_CRED, KRB_ERROR, TGS_REP, TGS_REQ, TICKET, VERSION

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods inherited from Element

attr_accessor, attributes, #attributes, decode, #initialize

Constructor Details

This class inherits a constructor from Rex::Proto::Kerberos::Model::Element

Instance Attribute Details

#etype_info2_entriesArray<Rex::Proto::Kerberos::Model::PreAuthEtypeInfo2Entry>

Returns The list of all etype_info entries.

Returns:



13
14
15
# File 'lib/rex/proto/kerberos/model/pre_auth_etype_info2.rb', line 13

def etype_info2_entries
  @etype_info2_entries
end

Instance Method Details

#decode(input) ⇒ self

Decodes the Rex::Proto::Kerberos::Model::PreAuthEtypeInfo2 from an input

Parameters:

  • input (String, OpenSSL::ASN1::ASN1Data)

    the input to decode from

Returns:

  • (self)

    if decoding succeeds

Raises:



20
21
22
23
24
25
26
27
28
29
30
31
# File 'lib/rex/proto/kerberos/model/pre_auth_etype_info2.rb', line 20

def decode(input)
  case input
  when String
    decode_string(input)
  when OpenSSL::ASN1::ASN1Data
    decode_asn1(input)
  else
    raise ::Rex::Proto::Kerberos::Model::Error::KerberosDecodingError, 'Failed to decode ETYPE-INFO2, invalid input'
  end

  self
end

#encodeObject



33
34
35
36
37
# File 'lib/rex/proto/kerberos/model/pre_auth_etype_info2.rb', line 33

def encode
  seq = encode_entries

  seq.to_der
end