| Wallet::Object::Keytab(3pm) | User Contributed Perl Documentation | Wallet::Object::Keytab(3pm) |
Wallet::Object::Keytab - Keytab object implementation for wallet
my @name = qw(keytab host/shell.example.com);
my @trace = ($user, $host, time);
my $object = Wallet::Object::Keytab->create (@name, $schema, @trace);
my $keytab = $object->get (@trace);
$object->destroy (@trace);
Wallet::Object::Keytab is a representation of Kerberos keytab objects in the wallet. It implements the wallet object API and provides the necessary glue to create principals in a Kerberos KDC, create and return keytabs for those principals, and delete them out of Kerberos when the wallet object is destroyed.
A keytab is an on-disk store for the key or keys for a Kerberos principal. Keytabs are used by services to verify incoming authentication from clients or by automated processes that need to authenticate to Kerberos. To create a keytab, the principal has to be created in Kerberos and then a keytab is generated and stored in a file on disk.
This implementation generates a new random key (and hence invalidates all existing keytabs) each time the keytab is retrieved with the get() method.
To use this object, several configuration parameters must be set. See Wallet::Config for details on those configuration parameters and information about how to set wallet configuration.
This object mostly inherits from Wallet::Object::Base. See the documentation for that class for all generic methods. Below are only those methods that are overridden or behave specially for this implementation.
If this attribute is set, the principal will be restricted to that specific enctype list when get() is called for that keytab. If it is not set, the default set in the KDC will be used.
This attribute is ignored if the "unchanging" flag is set on a keytab. Keytabs retrieved with "unchanging" set will contain all keys present in the KDC for that Kerberos principal and therefore may contain different enctypes than those requested by this attribute.
If no other arguments besides ATTRIBUTE are given, returns the values of that attribute, if any, as a list. On error, returns the empty list. To distinguish between an error and an empty return, call error() afterward. It is guaranteed to return undef unless there was an error.
If other arguments are given, sets the given ATTRIBUTE values to VALUES, which must be a reference to an array (even if only one value is being set). Pass a reference to an empty array to clear the attribute values. PRINCIPAL, HOSTNAME, and DATETIME are stored as history information. PRINCIPAL should be the user who is destroying the object. If DATETIME isn't given, the current time is used.
When a new keytab object is created, the Kerberos principal designated by NAME is also created in the Kerberos realm determined from the wallet configuration. If the principal already exists, create() still succeeds (so that a previously unmanaged principal can be imported into the wallet). Otherwise, if the Kerberos principal could not be created, create() fails. The principal is created with the randomized keys. NAME must not contain the realm; instead, the KEYTAB_REALM configuration variable should be set. See Wallet::Config for more information.
If create() fails, it throws an exception.
Only one Kerberos realm is supported for a given wallet implementation and all keytab objects stored must be in that realm. Keytab names in the wallet database do not have realm information.
kadmin(8), Wallet::Config(3), Wallet::Object::Base(3), wallet-backend(8)
This module is part of the wallet system. The current version is available from <https://www.eyrie.org/~eagle/software/wallet/>.
Russ Allbery <eagle@eyrie.org>
| 2024-11-12 | perl v5.40.0 |