com.ibm.security.krb5.internal.ktab

Class StreamKeyTab

  1. java.lang.Object
  2. extended bycom.ibm.security.krb5.internal.ktab.StreamKeyTab

  1. public class StreamKeyTab
  2. extends java.lang.Object
Provides a stream-based interface for managing a Kerberos key table.
Version:
1.1, 5/7/07
Author:
Thomas Owusu

Constructor Summary

Constructor and Description
StreamKeyTab(java.io.InputStream inputKeytab)
StreamKeyTab(java.io.InputStream inputKeytab,java.io.OutputStream outputKeytab)
StreamKeyTab(java.io.OutputStream outputKeytab)

Method Summary

Modifier and Type Method and Description
  1. void
addEntry(PrincipalName service,java.lang.String psswd)
Adds a new entry in the key table.
  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. KeyTabEntry[]
getEntries()
Gets the list of service entries in key table.
  1. KeyTabEntry
getEntry(PrincipalName service)
Reads the service entry from the key table.
  1. EncryptionKey
getKey(PrincipalName service,int enctype)
  1. EncryptionKey
readServiceKey(PrincipalName service)
Reads the service key from the keytab file.
  1. void
save()
Saves the file at the directory.
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructor Detail

StreamKeyTab

  1. public StreamKeyTab(java.io.InputStream inputKeytab)
  2. throws java.io.IOException
  3. KrbException
Throws:
java.io.IOException

StreamKeyTab

  1. public StreamKeyTab(java.io.InputStream inputKeytab,
  2. java.io.OutputStream outputKeytab)
  3. throws java.io.IOException
  4. KrbException
Throws:
java.io.IOException

StreamKeyTab

  1. public StreamKeyTab(java.io.OutputStream outputKeytab)
  2. throws java.io.IOException
  3. KrbException
Throws:
java.io.IOException

Method Detail

getEntry

  1. public KeyTabEntry getEntry(PrincipalName service)
Reads the service entry from the key table.
Parameters:
service - the PrincipalName of the requested service. A null service name will return the latest entry in the key table.
Returns:
service key.

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. A null service name will return the latest entry 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.

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.

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.