com.dstc.security.kerberos
Class FileKeyTab
java.lang.Object
|
+--com.dstc.security.kerberos.FileKeyTab
- public final class FileKeyTab
- extends Object
- implements KeyTab
A KeyTab implementing the MIT v5 keytab.
MIT v5 keytabs are file based and protected only with file permissions.
Compatibility tests have been done against MIT Kerberos V versions
1.0.6 to 1.2 inclusive.
Method Summary |
Iterator |
getKeyTabEntries()
Returns an Iterator for all KeyTabEntrys in this KeyTab
Note: to ensure thread-safety, it is necessary to synchronize on
KeyTab instance until all operations on the Iterator instance
are completed. |
KeyTabEntry |
getKeyTabEntry(String serviceName)
Returns a KeyTabEntry for a given principal |
String |
getKeyTabType()
Returns the key tab type for this KeyTab |
void |
load(File file)
Loads a KeyTab from a file |
String |
toString()
Returns a user readable representation of this KeyTab |
FileKeyTab
public FileKeyTab()
load
public void load(File file)
throws IOException
- Loads a KeyTab from a file
getKeyTabEntry
public KeyTabEntry getKeyTabEntry(String serviceName)
- Description copied from interface: KeyTab
- Returns a KeyTabEntry for a given principal
- Specified by:
- getKeyTabEntry in interface KeyTab
getKeyTabType
public String getKeyTabType()
- Description copied from interface: KeyTab
- Returns the key tab type for this KeyTab
- Specified by:
- getKeyTabType in interface KeyTab
getKeyTabEntries
public Iterator getKeyTabEntries()
- Description copied from interface: KeyTab
- Returns an Iterator for all KeyTabEntrys in this KeyTab
Note: to ensure thread-safety, it is necessary to synchronize on
KeyTab instance until all operations on the Iterator instance
are completed. eg.
KeyTab keytab = ...;
...
synchronized (keytab) {
Iterator it = keytab.getKeyTabEntries();
// perform all necessary operations on iterator
...
}
- Specified by:
- getKeyTabEntries in interface KeyTab
toString
public String toString()
- Returns a user readable representation of this KeyTab
- Overrides:
- toString in class Object