Class: Rex::Proto::Kerberos::Model::KrbCredInfo
- Defined in:
- lib/rex/proto/kerberos/model/krb_cred_info.rb
Overview
This class provides a representation of a KrbCredInfo object
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
-
#auth_time ⇒ Time
The time of initial authentication for the named principal.
-
#caddr ⇒ Rex::Proto::Kerberos::Model::HostAddress
These are the addresses from which the ticket can be used.
-
#end_time ⇒ Time
not be honored (its expiration time).
-
#flags ⇒ Rex::Proto::Kerberos::Model::KdcOptionFlags
requested when the ticket was issued.
-
#key ⇒ Rex::Proto::Kerberos::Model::EncryptionKey
The session key associated with a corresponding ticket in the enclosing KrbCred object.
-
#pname ⇒ Rex::Proto::Kerberos::Model::PrincipalName
The name of the principal identity.
-
#prealm ⇒ String
The realm for the principal identity.
-
#renew_till ⇒ Time
RENEWABLE flag set in the flags field.
-
#sname ⇒ Rex::Proto::Kerberos::Model::PrincipalName
The name part of the server’s identity.
-
#srealm ⇒ String
The realm part of the server’s principal identifier.
-
#start_time ⇒ Time
Specifies the time after which the ticket is valid.
Instance Method Summary collapse
- #==(other) ⇒ Object
-
#decode(input) ⇒ self
Decodes the Rex::Proto::Kerberos::Model::KrbCredInfo from an input.
- #encode ⇒ Object
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
#auth_time ⇒ Time
Returns the time of initial authentication for the named principal.
24 25 26 |
# File 'lib/rex/proto/kerberos/model/krb_cred_info.rb', line 24 def auth_time @auth_time end |
#caddr ⇒ Rex::Proto::Kerberos::Model::HostAddress
Returns These are the addresses from which the ticket can be used.
45 46 47 |
# File 'lib/rex/proto/kerberos/model/krb_cred_info.rb', line 45 def caddr @caddr end |
#end_time ⇒ Time
not be honored (its expiration time)
31 32 33 |
# File 'lib/rex/proto/kerberos/model/krb_cred_info.rb', line 31 def end_time @end_time end |
#flags ⇒ Rex::Proto::Kerberos::Model::KdcOptionFlags
requested when the ticket was issued
21 22 23 |
# File 'lib/rex/proto/kerberos/model/krb_cred_info.rb', line 21 def flags @flags end |
#key ⇒ Rex::Proto::Kerberos::Model::EncryptionKey
Returns The session key associated with a corresponding ticket in the enclosing KrbCred object.
11 12 13 |
# File 'lib/rex/proto/kerberos/model/krb_cred_info.rb', line 11 def key @key end |
#pname ⇒ Rex::Proto::Kerberos::Model::PrincipalName
Returns The name of the principal identity.
17 18 19 |
# File 'lib/rex/proto/kerberos/model/krb_cred_info.rb', line 17 def pname @pname end |
#prealm ⇒ String
Returns The realm for the principal identity.
14 15 16 |
# File 'lib/rex/proto/kerberos/model/krb_cred_info.rb', line 14 def prealm @prealm end |
#renew_till ⇒ Time
RENEWABLE flag set in the flags field. It indicates the maximum endtime that may be included in a renewal
36 37 38 |
# File 'lib/rex/proto/kerberos/model/krb_cred_info.rb', line 36 def renew_till @renew_till end |
#sname ⇒ Rex::Proto::Kerberos::Model::PrincipalName
Returns The name part of the server’s identity.
42 43 44 |
# File 'lib/rex/proto/kerberos/model/krb_cred_info.rb', line 42 def sname @sname end |
#srealm ⇒ String
Returns The realm part of the server’s principal identifier.
39 40 41 |
# File 'lib/rex/proto/kerberos/model/krb_cred_info.rb', line 39 def srealm @srealm end |
#start_time ⇒ Time
Returns Specifies the time after which the ticket is valid.
27 28 29 |
# File 'lib/rex/proto/kerberos/model/krb_cred_info.rb', line 27 def start_time @start_time end |
Instance Method Details
#==(other) ⇒ Object
47 48 49 50 51 52 53 54 55 56 57 58 59 |
# File 'lib/rex/proto/kerberos/model/krb_cred_info.rb', line 47 def ==(other) key == other.key && prealm == other.prealm && pname == other.pname && flags == other.flags && auth_time == other.auth_time && start_time == other.start_time && end_time == other.end_time && renew_till == other.renew_till && srealm == other.srealm && sname == other.sname && caddr == other.caddr end |
#decode(input) ⇒ self
Decodes the Rex::Proto::Kerberos::Model::KrbCredInfo from an input
66 67 68 69 70 71 72 73 74 75 76 77 |
# File 'lib/rex/proto/kerberos/model/krb_cred_info.rb', line 66 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 KrbCredInfo, invalid input' end self end |
#encode ⇒ Object
79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 |
# File 'lib/rex/proto/kerberos/model/krb_cred_info.rb', line 79 def encode elems = [] elems << OpenSSL::ASN1::ASN1Data.new([encode_key], 0, :CONTEXT_SPECIFIC) elems << OpenSSL::ASN1::ASN1Data.new([encode_prealm], 1, :CONTEXT_SPECIFIC) if prealm elems << OpenSSL::ASN1::ASN1Data.new([encode_pname], 2, :CONTEXT_SPECIFIC) if pname elems << OpenSSL::ASN1::ASN1Data.new([encode_flags], 3, :CONTEXT_SPECIFIC) if flags elems << OpenSSL::ASN1::ASN1Data.new([encode_auth_time], 4, :CONTEXT_SPECIFIC) if auth_time elems << OpenSSL::ASN1::ASN1Data.new([encode_start_time], 5, :CONTEXT_SPECIFIC) if start_time elems << OpenSSL::ASN1::ASN1Data.new([encode_end_time], 6, :CONTEXT_SPECIFIC) if end_time elems << OpenSSL::ASN1::ASN1Data.new([encode_renew_till], 7, :CONTEXT_SPECIFIC) if renew_till elems << OpenSSL::ASN1::ASN1Data.new([encode_srealm], 8, :CONTEXT_SPECIFIC) if srealm elems << OpenSSL::ASN1::ASN1Data.new([encode_sname], 9, :CONTEXT_SPECIFIC) if sname elems << OpenSSL::ASN1::ASN1Data.new([encode_caddr], 10, :CONTEXT_SPECIFIC) if caddr seq = OpenSSL::ASN1::Sequence.new(elems) seq.to_der end |