public class

KeyTab

extends Object
implements KeyTabConstants
java.lang.Object
   ↳ sun.security.mule.krb5.internal.ktab.KeyTab

Class Overview

This class represents key table. The key table functions deal with storing and retrieving service keys for use in authentication exchanges.

Summary

[Expand]
Inherited Constants
From interface sun.security.mule.krb5.internal.ktab.KeyTabConstants
Fields
private static final boolean DEBUG
private Vector<KeyTabEntry> entries
int kt_vno
private static String name
private static KeyTab singleton
Public Methods
void addEntry(PrincipalName service, char[] psswd, Config kerberosConfig)
Adds a new entry in the key table.
synchronized static KeyTab create(String name, Config kerberosConfig)
Creates a new default key table.
synchronized static KeyTab create(Config kerberosConfig)
Creates a new default key table.
synchronized void createVersion(File file)
Creates key table file version.
void deleteEntry(PrincipalName service)
Removes an entry from the key table.
boolean findServiceEntry(PrincipalName service)
Searches for the service entry in the keytab file.
KeyTabEntry[] getEntries()
Gets the list of service entries in key table.
static KeyTab getInstance(String s, Config kerberosConfig)
static KeyTab getInstance(File file, Config kerberosConfig)
Gets the single instance of KeyTab class.
static KeyTab getInstance(Config kerberosConfig)
Gets the single instance of KeyTab class.
EncryptionKey readServiceKey(PrincipalName service)
Reads the service key from the keytab file.
EncryptionKey[] readServiceKeys(PrincipalName service, Config kerberosConfig)
Reads all keys for a service from the keytab file that have etypes that have been configured for use.
static void refresh()
synchronized void save()
Saves the file at the directory.
static String tabName()
[Expand]
Inherited Methods
From class java.lang.Object

Fields

private static final boolean DEBUG

private Vector<KeyTabEntry> entries

int kt_vno

private static String name

private static KeyTab singleton

Public Methods

public void addEntry (PrincipalName service, char[] psswd, Config kerberosConfig)

Adds a new entry in the key table.

Parameters
service The service which will have a new entry in the key table.
psswd The password which generates the key.
kerberosConfig
Throws
KrbException

public static synchronized KeyTab create (String name, Config kerberosConfig)

Creates a new default key table.

Parameters
name
kerberosConfig
Throws
IOException
RealmException

public static synchronized KeyTab create (Config kerberosConfig)

Creates a new default key table.

Parameters
kerberosConfig
Throws
IOException
RealmException

public synchronized void createVersion (File file)

Creates key table file version.

Parameters
file The key table file.
Throws
IOException

public void deleteEntry (PrincipalName service)

Removes an entry from the key table.

Parameters
service The service PrincipalName.

public boolean findServiceEntry (PrincipalName service)

Searches for the service entry in the keytab file. The etype of the key must be one that has been configured to be used.

Parameters
service The PrincipalName of the requested service.
Returns
  • true if the entry is found, otherwise, return false.

public KeyTabEntry[] getEntries ()

Gets the list of service entries in key table.

Returns
  • array of KeyTabEntry.

public static KeyTab getInstance (String s, Config kerberosConfig)

Parameters
s
kerberosConfig

public static KeyTab getInstance (File file, Config kerberosConfig)

Gets the single instance of KeyTab class.

Parameters
file The key tab file.
kerberosConfig
Returns
  • single instance of KeyTab; return null if error occurs while reading data out of the file.

public static KeyTab getInstance (Config kerberosConfig)

Gets the single instance of KeyTab class.

Parameters
kerberosConfig
Returns
  • single instance of KeyTab; return null if default keytab file does not exist, or error occurs while reading data from the file.

public EncryptionKey readServiceKey (PrincipalName service)

Reads the service key from the keytab file.

Parameters
service The PrincipalName of the requested service.
Returns
  • the last service key in the keytab

public EncryptionKey[] readServiceKeys (PrincipalName service, Config kerberosConfig)

Reads all keys for a service from the keytab file that have etypes that have been configured for use.

Parameters
service The PrincipalName of the requested service
kerberosConfig
Returns
  • an array containing all the service keys

public static void refresh ()

public synchronized void save ()

Saves the file at the directory.

Throws
IOException

public static String tabName ()