# Assumes a working krb5 setup with /etc/krb5.conf.
# Doesn't seeem to work without username and realm.
cc = Kerberos::Krb5::CredentialsCache.new('jslatter@JSLATTERY.ORG')
# /tmp/krb5cc_1000 now exists. klist just shows principals.
k = Kerberos::Krb5.new
k.get_init_creds_keytab('jslatter', 'krb5.keytab', nil, cc)
# klist shows creds.
cc.destroy
# /tmp/krb5cc_1000 is gone.