Class | GSSAPI::Simple |
In: |
lib/gssapi/simple.rb
|
Parent: | Object |
This class is a simple wrapper around the most common usage of GSSAPI. If you are looking at doing
something a bit more advanced you may want to check out the LibGSSAPI module.
context | [R] |
Initialize a new GSSAPI::Simple object @param [String] host_name the fully qualified host name @param [String] service_name 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.
Accept a security context that was initiated by a remote peer. @param [String] in_token The token sent by the remote client to initiate the context @return [String, true] If this is part of a continuation it will return a token to be passed back to the remote
otherwise it will simply return true.
Acquire security credentials. This does not log you in. It grabs the credentials from a cred cache or keytab. @param [Hash] opts options to pass to the gss_acquire_cred function. @option opts [String] :usage The credential usage type (:accept, :initiate, :both). It defaults to ‘accept’ since
this method is most usually called on the server only.
@return [true] It will return true if everything succeeds and the @scred variable will be set for future methods. If
an error ocurrs an exception will be raised.
Get textual representation of internal GSS name @return [String] textual representation of internal GSS name
Convert a String to a GSSAPI usable buffer (gss_buffer_desc) @param [String] str the string to convert
Initialize the GSS security context (client initiator). If there was a previous call that issued a
continue you can pass the continuation token in via the token param. If no flags are set the default flags are LibGSSAPI::GSS_C_MUTUAL_FLAG | LibGSSAPI::GSS_C_SEQUENCE_FLAG
@param [String] in_token an input token sent from the remote service in a continuation. @param [Hash] opts misc opts to be set @option opts [Fixnum] :flags override all other flags. If you set the :delegate option this option will override it.
@see http://tools.ietf.org/html/rfc4121#section-4.1.1.1
@option opts [Boolean] :delegate if true set the credential delegate flag @return [String, true] if a continuation flag is set it will return the output token that is needed to send
to the remote host. Otherwise it returns true and the GSS security context has been established.
Unwrap a message previously wrapped with gss_wrap. @param [String] msg The message to unwrap @param [Boolean] encrypted Whether or not this message was encrypted (true) or just signed (false)
Wrap a message using gss_wrap. It can either encrypt the message (confidentiality) or simply sign it (integrity). @param [String] msg The message to wrap @param [Boolean] encrypt Whether or not to encrypt the message or just sign it. The default is to encrypt. @return [String] The wrapped message. It will raise an exception on error