Module gss_krb5

GSS mechanism module using Kerberos credentials (based on RFC1964).

Behaviours: gss_mechanism.

Description

GSS mechanism module using Kerberos credentials (based on RFC1964).

Data Types

message()

message() = gss_mechanism:message()

msec()

msec() = integer()

options()

options() = gss_mechanism:general_options() | #{ticket => krb_proto:ticket(), keytab => [krb_mit_keytab:keytab_entry()], max_skew => msec()}

state()

state() = gss_mechanism:state()

token()

token() = gss_mechanism:token()

Function Index

accept/2Begins a new GSS context as the acceptor (listening) party.
continue/2Continues an initiate() or accept() operation with a new token from the other party.
delete/1Destroys a GSS context, producing a token informing the other party (if the mechanism supports it).
get_mic/2Computes a MIC (Message Integrity Check) token for a given message.
initiate/1Begins a new GSS context as the initiator (connecting) party.
local_name/1Retrieves the local party's name in the GSS context.
peer_name/1Retrieves the remote (peer) party's authenticated name in the GSS context.
peer_ticket/1Retrieves the peer's Kerberos ticket if available (only possible if we are the accepting party).
translate_name/2Translates a name into a more useful generalised form.
unwrap/2Validates and unpacks a Wrap token which has been received, returning the enclosed message.
verify_mic/3Verifies a MIC token which has been received alongside the given message.
wrap/2Wraps a message into a token, which may encrypt and checksum it as needed (depending on mechanism and the options given).

Function Details

accept/2

accept(Token::token(), C::options()) -> {ok, token(), state()} | {continue, token(), state()} | {ok, state()} | gss_mechanism:fatal_error()

Begins a new GSS context as the acceptor (listening) party.

If returning {ok, token(), state()}, then the token is the last token in the setup flow (and after transporting it to the initiator, applications should begin calling get_mic/2 and wrap/2).

If returning {continue, token(), state()}, the mechanism expects a reply to the given token first, which should be given to continue/2.

continue/2

continue(Token::token(), S0::state()) -> {ok, token(), state()} | {continue, token(), state()} | {ok, state()} | gss_mechanism:fatal_error()

Continues an initiate() or accept() operation with a new token from the other party.

Return values have the same meaning as in initiate/1 or accept/2.

delete/1

delete(S0::state()) -> {ok, token()} | ok | gss_mechanism:fatal_error()

Destroys a GSS context, producing a token informing the other party (if the mechanism supports it).

get_mic/2

get_mic(Message::message(), S0::state()) -> {ok, token(), state()} | gss_mechanism:fatal_error()

Computes a MIC (Message Integrity Check) token for a given message.

A MIC token should be transported to the other party alongside the message so that they may check its integrity (the token does not contain the message).

initiate/1

initiate(C::options()) -> {ok, token(), state()} | {continue, token(), state()} | {ok, state()} | gss_mechanism:fatal_error()

Begins a new GSS context as the initiator (connecting) party.

If returning {ok, token(), state()}, then the token is the last token in the setup flow (and after transporting it to the acceptor, applications should begin calling get_mic/2 and wrap/2).

If returning {continue, token(), state()}, the mechanism expects a reply to the given token first, which should be given to continue/2.

local_name/1

local_name(X1::state()) -> {ok, gss_mechanism:internal_name()} | {error, not_yet_available}

Retrieves the local party's name in the GSS context.

peer_name/1

peer_name(X1::state()) -> {ok, gss_mechanism:internal_name()} | {error, not_yet_available}

Retrieves the remote (peer) party's authenticated name in the GSS context.

peer_ticket/1

peer_ticket(S0::state()) -> {ok, #'Ticket'{}, state()} | {error, not_yet_available}

Retrieves the peer's Kerberos ticket if available (only possible if we are the accepting party).

translate_name/2

translate_name(Name::gss_mechanism:internal_name(), Oid::gss_mechanism:oid() | any) -> {ok, gss_mechanism:display_name()} | {error, bad_name} | {error, bad_target_oid}

Translates a name into a more useful generalised form.

unwrap/2

unwrap(Token::token(), S0::state()) -> {ok, message(), state()} | gss_mechanism:per_msg_error() | gss_mechanism:fatal_error()

Validates and unpacks a Wrap token which has been received, returning the enclosed message.

verify_mic/3

verify_mic(Message::message(), Token::token(), S0::state()) -> {ok, state()} | gss_mechanism:per_msg_error() | gss_mechanism:fatal_error()

Verifies a MIC token which has been received alongside the given message.

wrap/2

wrap(Message::message(), S0::state()) -> {ok, token(), state()} | gss_mechanism:fatal_error()

Wraps a message into a token, which may encrypt and checksum it as needed (depending on mechanism and the options given).

A Wrap Token should be transported to the other party without any additional information.


Generated by EDoc