public class Keytab extends Object
| Modifier and Type | Field and Description |
|---|---|
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 and Description |
|---|
Keytab() |
| Modifier and Type | Method and Description |
|---|---|
protected static byte[] |
getBytesFromFile(File file)
Returns the contents of the
File in a byte array. |
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(File file)
Read a keytab file.
|
void |
setEntries(List<KeytabEntry> entries) |
void |
setKeytabVersion(byte[] keytabVersion) |
void |
write(File file)
Write the keytab to a
File. |
protected void |
writeFile(ByteBuffer buffer,
File file)
Write the contents of the
ByteBuffer to a File. |
public static final byte[] VERSION_51
public static final byte[] VERSION_52
public static Keytab read(File file) throws IOException
file - IOExceptionpublic static Keytab getInstance()
public void write(File file) throws IOException
File.file - IOExceptionpublic void setEntries(List<KeytabEntry> entries)
entries - The entries to set.public void setKeytabVersion(byte[] keytabVersion)
keytabVersion - The keytabVersion to set.public List<KeytabEntry> getEntries()
public byte[] getKeytabVersion()
protected static byte[] getBytesFromFile(File file) throws IOException
File in a byte array.file - IOExceptionprotected void writeFile(ByteBuffer buffer, File file) throws IOException
ByteBuffer to a File.buffer - file - IOExceptionCopyright © 2003-2013 The Apache Software Foundation. All Rights Reserved.