Class: Rex::Proto::Kerberos::Model::Element
- Inherits:
-
Object
- Object
- Rex::Proto::Kerberos::Model::Element
- Includes:
- Crypto, Rex::Proto::Kerberos::Model
- Defined in:
- lib/rex/proto/kerberos/model/element.rb
Overview
This class provides a representation of a principal, an asset (e.g., a workstation user or a network server) on a network.
Direct Known Subclasses
ApReq, Authenticator, AuthorizationData, Checksum, EncKdcResponse, EncryptedData, EncryptionKey, KdcRequest, KdcRequestBody, KdcResponse, KrbError, LastRequest, PreAuthData, PreAuthEncTimeStamp, PreAuthPacRequest, PrincipalName, Ticket
Constant Summary
Constants included from Rex::Proto::Kerberos::Model
AD_IF_RELEVANT, AP_REQ, AS_REP, AS_REQ, AUTHENTICATOR, ERROR_CODES, KDC_OPTION_ALLOW_POST_DATE, KDC_OPTION_ENC_TKT_IN_SKEY, KDC_OPTION_FORWARDABLE, KDC_OPTION_FORWARDED, KDC_OPTION_POST_DATED, KDC_OPTION_PROXIABLE, KDC_OPTION_PROXY, KDC_OPTION_RENEW, KDC_OPTION_RENEWABLE, KDC_OPTION_RENEWABLE_OK, KDC_OPTION_RESERVED, KDC_OPTION_UNUSED_10, KDC_OPTION_UNUSED_11, KDC_OPTION_UNUSED_7, KDC_OPTION_UNUSED_9, KDC_OPTION_VALIDATE, KRB_ERROR, NT_PRINCIPAL, NT_SRV_HST, NT_SRV_INST, NT_SRV_XHST, NT_UID, NT_UNKNOWN, PA_ENC_TIMESTAMP, PA_PAC_REQUEST, PA_PW_SALT, PA_TGS_REQ, TGS_REP, TGS_REQ, TICKET, VERSION
Constants included from Crypto
Crypto::ENC_AS_RESPONSE, Crypto::ENC_KDC_REQUEST_BODY, Crypto::ENC_TGS_RESPONSE, Crypto::RC4_HMAC, Crypto::RSA_MD5
Class Method Summary collapse
- .attr_accessor(*vars) ⇒ Object
-
.attributes ⇒ Array
Retrieves the element class fields.
- .decode(input) ⇒ Object
Instance Method Summary collapse
-
#attributes ⇒ Array
Retrieves the element instance fields.
-
#decode(input) ⇒ Object
Decodes the Rex::Proto::Kerberos::Model::Element from the input.
-
#encode ⇒ Object
Encodes the Rex::Proto::Kerberos::Model::Element into an ASN.1 String.
-
#initialize(options = {}) ⇒ Element
constructor
A new instance of Element.
Methods included from Crypto::RsaMd5
Methods included from Crypto::Rc4Hmac
#decrypt_rc4_hmac, #encrypt_rc4_hmac
Constructor Details
#initialize(options = {}) ⇒ Element
Returns a new instance of Element.
32 33 34 35 36 37 38 39 |
# File 'lib/rex/proto/kerberos/model/element.rb', line 32 def initialize( = {}) self.class.attributes.each do |attr| if .has_key?(attr) m = (attr.to_s + '=').to_sym self.send(m, [attr]) end end end |
Class Method Details
.attr_accessor(*vars) ⇒ Object
14 15 16 17 18 |
# File 'lib/rex/proto/kerberos/model/element.rb', line 14 def self.attr_accessor(*vars) @attributes ||= [] @attributes.concat vars super(*vars) end |
.attributes ⇒ Array
Retrieves the element class fields
23 24 25 |
# File 'lib/rex/proto/kerberos/model/element.rb', line 23 def self.attributes @attributes end |
.decode(input) ⇒ Object
27 28 29 30 |
# File 'lib/rex/proto/kerberos/model/element.rb', line 27 def self.decode(input) elem = self.new elem.decode(input) end |
Instance Method Details
#attributes ⇒ Array
Retrieves the element instance fields
44 45 46 |
# File 'lib/rex/proto/kerberos/model/element.rb', line 44 def attributes self.class.attributes end |
#decode(input) ⇒ Object
Decodes the Rex::Proto::Kerberos::Model::Element from the input. This method has been designed to be overridden by subclasses.
52 53 54 |
# File 'lib/rex/proto/kerberos/model/element.rb', line 52 def decode(input) raise ::NoMethodError, 'Method designed to be overridden' end |
#encode ⇒ Object
Encodes the Rex::Proto::Kerberos::Model::Element into an ASN.1 String. This method has been designed to be overridden by subclasses.
60 61 62 |
# File 'lib/rex/proto/kerberos/model/element.rb', line 60 def encode raise ::NoMethodError, 'Method designed to be overridden' end |