com.ibm.security.krb5.internal.ktab

Class KeyTab

  1. java.lang.Object
  2. extended bycom.ibm.security.krb5.internal.ktab.KeyTab
All implemented interfaces:
KeyTabConstants

  1. public class KeyTab
  2. extends java.lang.Object
  3. implements KeyTabConstants
This class represents key table. The key table functions deal with storing and retrieving service keys for use in authentication exchanges.
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
  1. protected
KeyTab()
Creates a new KeyTab object.

Method Summary

Modifier and Type Method and Description
  1. void
addEntry(KeyTabEntry entry)
Adds the specified entry to the keytable.
  1. void
addEntry(PrincipalName service,java.lang.String psswd)
Adds a new entry in the key table.
  1. static
  2. KeyTab
create()
Creates a new default key table.
  1. static
  2. KeyTab
create(java.lang.String name)
Creates a new default key table.
  1. void
createVersion(java.io.File file)
Creates key table file version.
  1. void
deleteEntry(PrincipalName service)
Removes an entry from the key table.
  1. boolean
findServiceEntry(PrincipalName service)
Searches for the service entry in the keytab file.
  1. EncryptionKey[]
getAllKeys(PrincipalName service)
  1. static
  2. java.lang.String
getDefaultKeyTab()
DOCUMENT ME!
  1. KeyTabEntry[]
getEntries()
Gets the list of service entries in key table.
  1. KeyTabEntry
getEntry(PrincipalName service)
Returns the key table entry for the specified service.
  1. static
  2. KeyTab
getInstance()
Gets the single instance of KeyTab class.
  1. static
  2. KeyTab
getInstance(java.io.File file)
Gets the single instance of KeyTab class.
  1. static
  2. KeyTab
getInstance(java.lang.String s)
DOCUMENT ME!
  1. EncryptionKey
getKey(PrincipalName service,int enctype)
  1. static
  2. KeyTab
loadKeyTabFile(java.io.File file)
  1. EncryptionKey
readServiceKey(PrincipalName service)
Reads the service key from the keytab file.
  1. static
  2. void
refresh()
refresh the keytab file
  1. void
save()
Saves the file at the directory.
  1. static
  2. java.lang.String
tabName()
DOCUMENT ME!
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructor Detail

KeyTab

  1. protected KeyTab()
Creates a new KeyTab object.

Method Detail

getInstance

  1. public static KeyTab getInstance( java.lang.String s)
  2. throws java.io.IOException
DOCUMENT ME!
Parameters:
s - DOCUMENT ME!
Returns:
DOCUMENT ME!
Throws:
java.io.IOException

getInstance

  1. public static KeyTab getInstance( java.io.File file)
  2. 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

  1. public static KeyTab getInstance( )
  2. 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

  1. public static KeyTab loadKeyTabFile( java.io.File file)
  2. throws java.io.IOException
Throws:
java.io.IOException

refresh

  1. public static void refresh()
  2. throws java.io.IOException
refresh the keytab file
Throws:
java.io.IOException

getDefaultKeyTab

  1. public static java.lang.String getDefaultKeyTab( )
DOCUMENT ME!
Returns:
DOCUMENT ME!

getEntry

  1. 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

  1. public EncryptionKey getKey(PrincipalName service,
  2. int enctype)

getAllKeys

  1. public EncryptionKey[] getAllKeys( PrincipalName service)

readServiceKey

  1. 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

  1. 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

  1. public static java.lang.String tabName( )
DOCUMENT ME!
Returns:
DOCUMENT ME!

addEntry

  1. public void addEntry(PrincipalName service,
  2. java.lang.String psswd)
  3. 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

  1. public KeyTabEntry[] getEntries( )
Gets the list of service entries in key table.
Returns:
array of KeyTabEntry.

create

  1. public static KeyTab create()
  2. throws java.io.IOException
  3. RealmException
Creates a new default key table.
Returns:
DOCUMENT ME!
Throws:
java.io.IOException

create

  1. public static KeyTab create(java.lang.String name)
  2. throws java.io.IOException
  3. RealmException
Creates a new default key table.
Parameters:
name - DOCUMENT ME!
Returns:
DOCUMENT ME!
Throws:
java.io.IOException

save

  1. public void save()
  2. throws java.io.IOException
Saves the file at the directory.
Throws:
java.io.IOException

deleteEntry

  1. public void deleteEntry(PrincipalName service)
Removes an entry from the key table.
Parameters:
service - the service PrincipalName.

createVersion

  1. public void createVersion(java.io.File file)
  2. throws java.io.IOException
Creates key table file version.
Parameters:
file - the key table file.
Throws:
IOException.
java.io.IOException

addEntry

  1. public void addEntry(KeyTabEntry entry)
Adds the specified entry to the keytable.
Parameters:
entry - DOCUMENT ME!