Class: Rex::Proto::Kerberos::Model::ApRep
- Defined in:
- lib/rex/proto/kerberos/model/ap_rep.rb
Overview
This class provides a representation of a Kerberos AP-REP (response) data definition
Constant Summary
Constants included from Rex::Proto::Kerberos::Model
AP_REP, AP_REQ, AS_REP, AS_REQ, AUTHENTICATOR, ENC_KRB_CRED_PART, KRB_CRED, KRB_ERROR, TGS_REP, TGS_REQ, TICKET, VERSION
Instance Attribute Summary collapse
-
#enc_part ⇒ Rex::Proto::Kerberos::Model::EncryptedData
The encrypted part of the response.
-
#msg_type ⇒ Integer
The type of a protocol message.
-
#pvno ⇒ Integer
The protocol version number.
Instance Method Summary collapse
-
#decode(input) ⇒ self
Decodes the Rex::Proto::Kerberos::Model::ApRep from an input.
- #decrypt_enc_part(key) ⇒ Object
-
#encode ⇒ Object
Rex::Proto::Kerberos::Model::ApRep encoding isn’t supported.
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
#enc_part ⇒ Rex::Proto::Kerberos::Model::EncryptedData
Returns The encrypted part of the response.
18 19 20 |
# File 'lib/rex/proto/kerberos/model/ap_rep.rb', line 18 def enc_part @enc_part end |
#msg_type ⇒ Integer
Returns The type of a protocol message.
15 16 17 |
# File 'lib/rex/proto/kerberos/model/ap_rep.rb', line 15 def msg_type @msg_type end |
#pvno ⇒ Integer
Returns The protocol version number.
12 13 14 |
# File 'lib/rex/proto/kerberos/model/ap_rep.rb', line 12 def pvno @pvno end |
Instance Method Details
#decode(input) ⇒ self
Decodes the Rex::Proto::Kerberos::Model::ApRep from an input
25 26 27 28 29 30 31 32 33 34 35 36 |
# File 'lib/rex/proto/kerberos/model/ap_rep.rb', line 25 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 ApRep, invalid input' end self end |
#decrypt_enc_part(key) ⇒ Object
45 46 47 48 49 |
# File 'lib/rex/proto/kerberos/model/ap_rep.rb', line 45 def decrypt_enc_part(key) data = enc_part.decrypt_asn1(key, Rex::Proto::Kerberos::Crypto::KeyUsage::AP_REP_ENCPART) result = Rex::Proto::Kerberos::Model::EncApRepPart::decode(data) end |
#encode ⇒ Object
Rex::Proto::Kerberos::Model::ApRep encoding isn’t supported
41 42 43 |
# File 'lib/rex/proto/kerberos/model/ap_rep.rb', line 41 def encode raise ::NotImplementedError, 'ApRep encoding not supported' end |