Dave Steiner


Authen::Krb5::KDB - Parse Kerberos V5 database dumps


    use Authen::Krb5::KDB;
    $db = Authen::Krb5::KDB->new( file => 'slave_datatrans' );
    while ($p = $db->next) {
       print "Found" if ($p->name eq 'foo@TEST.ORG');

    use Authen::Krb5::KDB;
    $db = Authen::Krb5::KDB->new( realm => 'TEST.ORG' );
    $policies = $db->policies;
    foreach my $p (@{$policies}) {


Constructor and methods to parse Kerberos V5 database files, either directly from kerberos (via kdb5_util) or from already dumped files (e.g. slave_datatrans).


Open the database file and return a new database object. You can either read from a file or read directly from Kerberos (done via "kdb5_util -r <realm> dump |"; this is the default).

Arguments are:

realm => <realm_name>

The realm which should be extracted via kdb5_util. This is ignored if you use the file argument.

file => <filename>

Read from a file instead of Kerberos directly.

checks => <level>

Data checking level. Level 0 means no checks; level 1 (the default) does basic checks like checking that the lengths in the records are correct; level 2 does much further consistency checks on the data.

save => 1

Save the principal objects in the database object. Normally the objects are not saved for space considerations. Note that policy objects are always kept.


Returns the next principal or policy object.


Reads all principals and policies. The objects are saved in the database object.


Returns a reference to array of principal objects


Returns a reference to array of policy objects


Closes FH to database. It's especially important to call close when reading directly via kdb5_util to make sure there are no errors from the pipe.


Dave Steiner, <steiner@bakerst.rutgers.edu>


Copyright (c) 2002 David K. Steiner. All rights reserved.

This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself.


perl(1), kerberos(1), Authen::Krb5::KDB::V5, Authen::Krb5::KDB::V4, Authen::Krb5::KDB::V3, Authen::Krb5::KDB::V2, Authen::Krb5::KDB_H.