Method: GSSAPI::Simple#initialize

Defined in:
lib/gssapi/simple.rb

#initialize(host_name, service_name = nil, keytab = nil) ⇒ Simple

Initialize a new GSSAPI::Simple object

Parameters:

  • host_name (String)

    the fully qualified host name

  • service_name (String) (defaults to: nil)

    The service name. This can either be a GSS_KRB5_NT_PRINCIPAL_NAME in the form of srvc/fqdn@REALM or GSS_C_NT_HOSTBASED_SERVICE in the form of srvc@fqdn If there is no ‘@fqdn’ part, the host_name will be appended. If no service_name is given at all the default service of ‘host@fqdn’ will be used.



22
23
24
25
26
27
28
29
# File 'lib/gssapi/simple.rb', line 22

def initialize(host_name, service_name=nil, keytab=nil)
  @host = host_name
  @service = service_name.nil? ? "host@#{@host}" : (service_name.include?('@') ? service_name : "#{service_name}@#{@host}")
  @int_svc_name = import_name(@service)
  @context = nil # the security context
  @scred = nil # the service credentials.  really only used for the server-side via acquire_credentials
  set_keytab(keytab) unless keytab.nil?
end