Sha256: c3997460b7a357193762f8e44d93acf6181648d39d820b5824c2b4fd6516135b

Contents?: true

Size: 1.69 KB

Versions: 7

Compression:

Stored size: 1.69 KB

Contents

# -*- coding: binary -*-

module Rex
  module Proto
    module Kerberos
      module CredentialCache
        # This class provides a representation of credential times stored in the Kerberos Credential Cache.
        class Time < Element
          # @!attribute auth_time
          #   @return [Fixnum]
          attr_accessor :auth_time
          # @!attribute start_time
          #   @return [Fixnum]
          attr_accessor :start_time
          # @!attribute end_time
          #   @return [Fixnum]
          attr_accessor :end_time
          # @!attribute renew_till
          #   @return [Fixnum]
          attr_accessor :renew_till

          # Encodes the Rex::Proto::Kerberos::CredentialCache::Time into an String
          #
          # @return [String] encoded time
          def encode
            encoded = ''
            encoded << encode_auth_time
            encoded << encode_start_time
            encoded << encode_end_time
            encoded << encode_renew_time

            encoded
          end

          private

          # Encodes the auth_time field
          #
          # @return [String]
          def encode_auth_time
            [auth_time].pack('N')
          end

          # Encodes the start_time field
          #
          # @return [String]
          def encode_start_time
            [start_time].pack('N')
          end

          # Encodes the end_time field
          #
          # @return [String]
          def encode_end_time
            [end_time].pack('N')
          end

          # Encodes the renew_time field
          #
          # @return [String]
          def encode_renew_time
            [renew_till].pack('N')
          end

        end
      end
    end
  end
end

Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
rex-2.0.13 lib/rex/proto/kerberos/credential_cache/time.rb
rex-2.0.12 lib/rex/proto/kerberos/credential_cache/time.rb
rex-2.0.11 lib/rex/proto/kerberos/credential_cache/time.rb
rex-2.0.10 lib/rex/proto/kerberos/credential_cache/time.rb
rex-2.0.9 lib/rex/proto/kerberos/credential_cache/time.rb
rex-2.0.8 lib/rex/proto/kerberos/credential_cache/time.rb
rex-2.0.7 lib/rex/proto/kerberos/credential_cache/time.rb