Class: Rex::Proto::Kerberos::Model::ApReq
- Defined in:
- lib/rex/proto/kerberos/model/ap_req.rb
Overview
This class provides a representation of a KRB_AP_REQ definition, containing the Kerberos protocol version number, the message type KRB_AP_REQ, an options field to indicate any options in use, and the ticket and authenticator themselves
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
-
#authenticator ⇒ Rex::Proto::Kerberos::Model::EncryptedData
client’s choice of a subkey.
-
#msg_type ⇒ Integer
The type of the protocol message.
-
#options ⇒ Integer
Request options, affects processing.
-
#pvno ⇒ Integer
The protocol version number.
-
#ticket ⇒ Rex::Proto::Kerberos::Model::Ticket
The ticket authenticating the client to the server.
Instance Method Summary collapse
-
#decode(input) ⇒ Object
Rex::Proto::Kerberos::Model::ApReq decoding isn’t supported.
-
#encode ⇒ String
Encodes the Rex::Proto::Kerberos::Model::ApReq into an ASN.1 String.
-
#to_asn1 ⇒ OpenSSL::ASN1::ASN1Data
The ap_req ASN1Data.
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
#authenticator ⇒ Rex::Proto::Kerberos::Model::EncryptedData
client’s choice of a subkey
26 27 28 |
# File 'lib/rex/proto/kerberos/model/ap_req.rb', line 26 def authenticator @authenticator end |
#msg_type ⇒ Integer
Returns The type of the protocol message.
16 17 18 |
# File 'lib/rex/proto/kerberos/model/ap_req.rb', line 16 def msg_type @msg_type end |
#options ⇒ Integer
Returns request options, affects processing.
19 20 21 |
# File 'lib/rex/proto/kerberos/model/ap_req.rb', line 19 def @options end |
#pvno ⇒ Integer
Returns The protocol version number.
13 14 15 |
# File 'lib/rex/proto/kerberos/model/ap_req.rb', line 13 def pvno @pvno end |
#ticket ⇒ Rex::Proto::Kerberos::Model::Ticket
Returns The ticket authenticating the client to the server.
22 23 24 |
# File 'lib/rex/proto/kerberos/model/ap_req.rb', line 22 def ticket @ticket end |
Instance Method Details
#decode(input) ⇒ Object
Rex::Proto::Kerberos::Model::ApReq decoding isn’t supported
31 32 33 |
# File 'lib/rex/proto/kerberos/model/ap_req.rb', line 31 def decode(input) raise ::NotImplementedError, 'AP-REQ decoding not supported' end |
#encode ⇒ String
Encodes the Rex::Proto::Kerberos::Model::ApReq into an ASN.1 String
38 39 40 |
# File 'lib/rex/proto/kerberos/model/ap_req.rb', line 38 def encode to_asn1.to_der end |
#to_asn1 ⇒ OpenSSL::ASN1::ASN1Data
Returns The ap_req ASN1Data.
43 44 45 46 47 48 49 50 51 52 53 54 55 56 |
# File 'lib/rex/proto/kerberos/model/ap_req.rb', line 43 def to_asn1 elems = [] elems << OpenSSL::ASN1::ASN1Data.new([encode_pvno], 0, :CONTEXT_SPECIFIC) elems << OpenSSL::ASN1::ASN1Data.new([encode_msg_type], 1, :CONTEXT_SPECIFIC) elems << OpenSSL::ASN1::ASN1Data.new([], 2, :CONTEXT_SPECIFIC) elems << OpenSSL::ASN1::ASN1Data.new([encode_ticket], 3, :CONTEXT_SPECIFIC) elems << OpenSSL::ASN1::ASN1Data.new([encode_authenticator], 4, :CONTEXT_SPECIFIC) seq = OpenSSL::ASN1::Sequence.new(elems) seq_asn1 = OpenSSL::ASN1::ASN1Data.new([seq], AP_REQ, :APPLICATION) seq_asn1 end |