org.apache.directory.server.kerberos.shared.keytab
Class Keytab

java.lang.Object
  extended by org.apache.directory.server.kerberos.shared.keytab.Keytab

public class Keytab
extends java.lang.Object

Keytab file.

Version:
$Rev$, $Date$
Author:
Apache Directory Project

Field Summary
static byte[] VERSION_51
          Byte array constant for keytab file format 5.1.
static byte[] VERSION_52
          Byte array constant for keytab file format 5.2.
 
Constructor Summary
Keytab()
           
 
Method Summary
protected static byte[] getBytesFromFile(java.io.File file)
          Returns the contents of the File in a byte array.
 java.util.List<KeytabEntry> getEntries()
           
static Keytab getInstance()
          Returns a new instance of a keytab with the version defaulted to 5.2.
 byte[] getKeytabVersion()
           
static Keytab read(java.io.File file)
          Read a keytab file.
 void setEntries(java.util.List<KeytabEntry> entries)
           
 void setKeytabVersion(byte[] keytabVersion)
           
 void write(java.io.File file)
          Write the keytab to a File.
protected  void writeFile(org.apache.mina.common.ByteBuffer buffer, java.io.File file)
          Write the contents of the ByteBuffer to a File.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

VERSION_51

public static final byte[] VERSION_51
Byte array constant for keytab file format 5.1.


VERSION_52

public static final byte[] VERSION_52
Byte array constant for keytab file format 5.2.

Constructor Detail

Keytab

public Keytab()
Method Detail

read

public static Keytab read(java.io.File file)
                   throws java.io.IOException
Read a keytab file.

Parameters:
file -
Returns:
The keytab.
Throws:
java.io.IOException

getInstance

public static Keytab getInstance()
Returns a new instance of a keytab with the version defaulted to 5.2.

Returns:
The keytab.

write

public void write(java.io.File file)
           throws java.io.IOException
Write the keytab to a File.

Parameters:
file -
Throws:
java.io.IOException

setEntries

public void setEntries(java.util.List<KeytabEntry> entries)
Parameters:
entries - The entries to set.

setKeytabVersion

public void setKeytabVersion(byte[] keytabVersion)
Parameters:
keytabVersion - The keytabVersion to set.

getEntries

public java.util.List<KeytabEntry> getEntries()
Returns:
The entries.

getKeytabVersion

public byte[] getKeytabVersion()
Returns:
The keytabVersion.

getBytesFromFile

protected static byte[] getBytesFromFile(java.io.File file)
                                  throws java.io.IOException
Returns the contents of the File in a byte array.

Parameters:
file -
Returns:
The byte array of the file contents.
Throws:
java.io.IOException

writeFile

protected void writeFile(org.apache.mina.common.ByteBuffer buffer,
                         java.io.File file)
                  throws java.io.IOException
Write the contents of the ByteBuffer to a File.

Parameters:
buffer -
file -
Throws:
java.io.IOException


Copyright © 2003-2009 Apache Software Foundation. All Rights Reserved.