Class: Rex::Proto::Kerberos::Model::PreAuthPacRequest

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

Overview

This class is a representation of a KERB-PA-PAC-REQUEST, pre authenticated data to explicitly request to include or exclude a PAC in the ticket.

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

#valueBoolean

Returns:

  • (Boolean)


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

def value
  @value
end

Instance Method Details

#decode(input) ⇒ self

Decodes a Rex::Proto::Kerberos::Model::PreAuthPacRequest

Parameters:

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

    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_pac_request.rb', line 20

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

  self
end

#encodeString

Encodes a Rex::Proto::Kerberos::Model::PreAuthPacRequest into an ASN.1 String

Returns:

  • (String)


37
38
39
40
41
42
# File 'lib/rex/proto/kerberos/model/pre_auth_pac_request.rb', line 37

def encode
  value_asn1 = OpenSSL::ASN1::ASN1Data.new([encode_value], 0, :CONTEXT_SPECIFIC)
  seq = OpenSSL::ASN1::Sequence.new([value_asn1])

  seq.to_der
end