com.ibm.security.krb5.internal.ktab
Class KeyTab
- java.lang.Object
com.ibm.security.krb5.internal.ktab.KeyTab
All implemented interfaces:
- public class KeyTab
- extends java.lang.Object
- implements KeyTabConstants
Version:
1.1, 5/7/07
Author:
Yanni Zhang
Field Summary
Fields inherited from interface com.ibm.security.krb5.internal.ktab.KeyTabConstants |
---|
keySize, keyTypeSize, keyVersionSize, KRB5_KT_VNO, KRB5_KT_VNO_1, principalComponentSize, principalSize, principalTypeSize, realmSize, timestampSize |
Constructor Summary
Modifier | Constructor and Description |
---|---|
|
KeyTab()
Creates a new KeyTab object.
|
Method Summary
Modifier and Type | Method and Description |
---|---|
|
addEntry(KeyTabEntry entry)
Adds the specified entry to the keytable.
|
|
addEntry(PrincipalName service,java.lang.String psswd)
Adds a new entry in the key table.
|
|
create()
Creates a new default key table.
|
|
create(java.lang.String name)
Creates a new default key table.
|
|
createVersion(java.io.File file)
Creates key table file version.
|
|
deleteEntry(PrincipalName service)
Removes an entry from the key table.
|
|
findServiceEntry(PrincipalName service)
Searches for the service entry in the keytab file.
|
getAllKeys(PrincipalName service)
|
|
|
getDefaultKeyTab()
DOCUMENT ME!
|
getEntries()
Gets the list of service entries in key table.
|
|
getEntry(PrincipalName service)
Returns the key table entry for the specified service.
|
|
|
getInstance()
Gets the single instance of KeyTab class.
|
|
getInstance(java.io.File file)
Gets the single instance of KeyTab class.
|
|
getInstance(java.lang.String s)
DOCUMENT ME!
|
getKey(PrincipalName service,int enctype)
|
|
|
loadKeyTabFile(java.io.File file)
|
readServiceKey(PrincipalName service)
Reads the service key from the keytab file.
|
|
|
refresh()
refresh the keytab file
|
|
save()
Saves the file at the directory.
|
|
tabName()
DOCUMENT ME!
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail
KeyTab
- protected KeyTab()
Creates a new KeyTab object.
Method Detail
getInstance
- public static KeyTab getInstance( java.lang.String s)
- throws java.io.IOException
DOCUMENT ME!
getInstance
- public static KeyTab getInstance( java.io.File file)
- throws java.io.IOException
Gets the single instance of KeyTab class.
Parameters:
file
- the key tab file. Returns:
single instance of KeyTab; return null if error occurs while
reading data out of the file.
Throws:
java.io.IOException
getInstance
- public static KeyTab getInstance( )
- throws java.io.IOException
Gets the single instance of KeyTab class.
Returns:
single instance of KeyTab; return null if default keytab file
does not exist, or error occurs while reading data from the
file.
Throws:
java.io.IOException
loadKeyTabFile
- public static KeyTab loadKeyTabFile( java.io.File file)
- throws java.io.IOException
Throws:
java.io.IOException
refresh
- public static void refresh()
- throws java.io.IOException
refresh the keytab file
Throws:
java.io.IOException
getDefaultKeyTab
- public static java.lang.String getDefaultKeyTab( )
DOCUMENT ME!
Returns:
DOCUMENT ME!
getEntry
- public KeyTabEntry getEntry(PrincipalName service)
Returns the key table entry for the specified service.
Parameters:
service
- the PrincipalName of the requested service. Specifying a
null service key will return the latest entry in the key table. Returns:
key table entry, or null if no entry found.
getKey
- public EncryptionKey getKey(PrincipalName service,
- int enctype)
getAllKeys
- public EncryptionKey[] getAllKeys( PrincipalName service)
readServiceKey
- public EncryptionKey readServiceKey( PrincipalName service)
Reads the service key from the keytab file.
Parameters:
service
- the PrincipalName of the requested service. Specifying a
null service key will return the latest key in the keytab. Returns:
service key.
findServiceEntry
- public boolean findServiceEntry( PrincipalName service)
Searches for the service entry in the keytab file.
Parameters:
service
- the PrincipalName of the requested service. Returns:
true if the entry is found, otherwise, return false.
tabName
- public static java.lang.String tabName( )
DOCUMENT ME!
Returns:
DOCUMENT ME!
addEntry
- public void addEntry(PrincipalName service,
- java.lang.String psswd)
- throws KrbCryptoException
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. Throws:
getEntries
- public KeyTabEntry[] getEntries( )
Gets the list of service entries in key table.
Returns:
array of
KeyTabEntry
. create
- public static KeyTab create()
- throws java.io.IOException
- RealmException
Creates a new default key table.
create
- public static KeyTab create(java.lang.String name)
- throws java.io.IOException
- RealmException
Creates a new default key table.
save
- public void save()
- throws java.io.IOException
Saves the file at the directory.
Throws:
java.io.IOException
deleteEntry
- public void deleteEntry(PrincipalName service)
Removes an entry from the key table.
Parameters:
service
- the service PrincipalName
. createVersion
- public void createVersion(java.io.File file)
- throws java.io.IOException
Creates key table file version.
Parameters:
file
- the key table file. Throws:
IOException.
java.io.IOException
addEntry
- public void addEntry(KeyTabEntry entry)
Adds the specified entry to the keytable.
Parameters:
entry
- DOCUMENT ME!