Class: Rex::Proto::Kerberos::Model::TicketEncPart
- Defined in:
- lib/rex/proto/kerberos/model/ticket_enc_part.rb
Overview
This class provides a representation of a Kerberos ticket encrypted part that helps a client authenticate to a service.
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
-
#authorization_data ⇒ Object
- 10
-
AuthorizationData OPTIONAL.
-
#authtime ⇒ Object
- 5
-
KerberosTime,.
-
#caddr ⇒ Object
- 9
-
HostAddresses OPTIONAL,.
-
#cname ⇒ Object
- 3
-
PrincipalName,.
-
#crealm ⇒ Object
- 2
-
Realm,.
-
#endtime ⇒ Object
- 7
-
KerberosTime,.
-
#flags ⇒ Object
- 0
-
TicketFlags,.
-
#key ⇒ Object
- 1
-
EncryptionKey,.
-
#renew_till ⇒ Object
- 8
-
KerberosTime OPTIONAL,.
-
#starttime ⇒ Object
- 6
-
KerberosTime OPTIONAL,.
-
#transited ⇒ Object
- 4
-
TransitedEncoding,.
Instance Method Summary collapse
-
#decode(input) ⇒ self
Decodes the Rex::Proto::Kerberos::Model::TicketEncPart from an input.
-
#encode ⇒ String
Encodes a Rex::Proto::Kerberos::Model::TicketEncPart into an ASN.1 String.
-
#to_asn1 ⇒ OpenSSL::ASN1::ASN1Data
Encodes a Rex::Proto::Kerberos::Model::TicketEncPart into ASN.1.
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
#authorization_data ⇒ Object
- 10
-
AuthorizationData OPTIONAL
18 19 20 |
# File 'lib/rex/proto/kerberos/model/ticket_enc_part.rb', line 18 def @authorization_data end |
#authtime ⇒ Object
- 5
-
KerberosTime,
13 14 15 |
# File 'lib/rex/proto/kerberos/model/ticket_enc_part.rb', line 13 def authtime @authtime end |
#caddr ⇒ Object
- 9
-
HostAddresses OPTIONAL,
17 18 19 |
# File 'lib/rex/proto/kerberos/model/ticket_enc_part.rb', line 17 def caddr @caddr end |
#cname ⇒ Object
- 3
-
PrincipalName,
11 12 13 |
# File 'lib/rex/proto/kerberos/model/ticket_enc_part.rb', line 11 def cname @cname end |
#crealm ⇒ Object
- 2
-
Realm,
10 11 12 |
# File 'lib/rex/proto/kerberos/model/ticket_enc_part.rb', line 10 def crealm @crealm end |
#endtime ⇒ Object
- 7
-
KerberosTime,
15 16 17 |
# File 'lib/rex/proto/kerberos/model/ticket_enc_part.rb', line 15 def endtime @endtime end |
#flags ⇒ Object
- 0
-
TicketFlags,
8 9 10 |
# File 'lib/rex/proto/kerberos/model/ticket_enc_part.rb', line 8 def flags @flags end |
#key ⇒ Object
- 1
-
EncryptionKey,
9 10 11 |
# File 'lib/rex/proto/kerberos/model/ticket_enc_part.rb', line 9 def key @key end |
#renew_till ⇒ Object
- 8
-
KerberosTime OPTIONAL,
16 17 18 |
# File 'lib/rex/proto/kerberos/model/ticket_enc_part.rb', line 16 def renew_till @renew_till end |
#starttime ⇒ Object
- 6
-
KerberosTime OPTIONAL,
14 15 16 |
# File 'lib/rex/proto/kerberos/model/ticket_enc_part.rb', line 14 def starttime @starttime end |
#transited ⇒ Object
- 4
-
TransitedEncoding,
12 13 14 |
# File 'lib/rex/proto/kerberos/model/ticket_enc_part.rb', line 12 def transited @transited end |
Instance Method Details
#decode(input) ⇒ self
Decodes the Rex::Proto::Kerberos::Model::TicketEncPart from an input
26 27 28 29 30 31 32 33 34 35 36 37 |
# File 'lib/rex/proto/kerberos/model/ticket_enc_part.rb', line 26 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 TicketEncPart, invalid input' end self end |
#encode ⇒ String
Encodes a Rex::Proto::Kerberos::Model::TicketEncPart into an ASN.1 String
42 43 44 |
# File 'lib/rex/proto/kerberos/model/ticket_enc_part.rb', line 42 def encode to_asn1.to_der end |
#to_asn1 ⇒ OpenSSL::ASN1::ASN1Data
Encodes a Rex::Proto::Kerberos::Model::TicketEncPart into ASN.1
50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 |
# File 'lib/rex/proto/kerberos/model/ticket_enc_part.rb', line 50 def to_asn1 elems = [] elems << OpenSSL::ASN1::ASN1Data.new([encode_flags], 0, :CONTEXT_SPECIFIC) elems << OpenSSL::ASN1::ASN1Data.new([encode_key], 1, :CONTEXT_SPECIFIC) elems << OpenSSL::ASN1::ASN1Data.new([encode_crealm], 2, :CONTEXT_SPECIFIC) elems << OpenSSL::ASN1::ASN1Data.new([encode_cname], 3, :CONTEXT_SPECIFIC) elems << OpenSSL::ASN1::ASN1Data.new([encode_transited], 4, :CONTEXT_SPECIFIC) elems << OpenSSL::ASN1::ASN1Data.new([encode_authtime], 5, :CONTEXT_SPECIFIC) elems << OpenSSL::ASN1::ASN1Data.new([encode_starttime], 6, :CONTEXT_SPECIFIC) if starttime elems << OpenSSL::ASN1::ASN1Data.new([encode_endtime], 7, :CONTEXT_SPECIFIC) elems << OpenSSL::ASN1::ASN1Data.new([encode_renew_till], 8, :CONTEXT_SPECIFIC) if renew_till elems << OpenSSL::ASN1::ASN1Data.new([encode_caddr], 9, :CONTEXT_SPECIFIC) if caddr elems << OpenSSL::ASN1::ASN1Data.new([], 10, :CONTEXT_SPECIFIC) if seq = OpenSSL::ASN1::Sequence.new(elems) OpenSSL::ASN1::ASN1Data.new([seq], 3, :APPLICATION) end |