public class MiniKdc extends Object
Modifier and Type | Field and Description |
---|---|
static String |
DEBUG |
static String |
INSTANCE |
static String |
KDC_BIND_ADDRESS |
static String |
KDC_PORT |
static String |
MAX_RENEWABLE_LIFETIME |
static String |
MAX_TICKET_LIFETIME |
static String |
ORG_DOMAIN |
static String |
ORG_NAME |
static String |
TRANSPORT |
Constructor and Description |
---|
MiniKdc(Properties conf,
File workDir)
Creates a MiniKdc.
|
Modifier and Type | Method and Description |
---|---|
static Properties |
createConf()
Convenience method that returns MiniKdc default configuration.
|
void |
createPrincipal(File keytabFile,
String... principals)
Creates multiple principals in the KDC and adds them to a keytab file.
|
void |
createPrincipal(String principal,
String password)
Creates a principal in the KDC with the specified user and password.
|
String |
getHost()
Returns the host of the MiniKdc.
|
File |
getKrb5conf() |
int |
getPort()
Returns the port of the MiniKdc.
|
String |
getRealm()
Returns the realm of the MiniKdc.
|
static void |
main(String[] args) |
void |
start()
Starts the MiniKdc.
|
void |
stop()
Stops the MiniKdc
|
public static final String ORG_NAME
public static final String ORG_DOMAIN
public static final String KDC_BIND_ADDRESS
public static final String KDC_PORT
public static final String INSTANCE
public static final String MAX_TICKET_LIFETIME
public static final String MAX_RENEWABLE_LIFETIME
public static final String TRANSPORT
public static final String DEBUG
public MiniKdc(Properties conf, File workDir) throws Exception
conf
- MiniKdc configuration.workDir
- working directory, it should be the build directory. Under
this directory an ApacheDS working directory will be created, this
directory will be deleted when the MiniKdc stops.Exception
- thrown if the MiniKdc could not be created.public static Properties createConf()
public int getPort()
public String getHost()
public String getRealm()
public File getKrb5conf()
public void start() throws Exception
Exception
- thrown if the MiniKdc could not be started.public void stop()
Exception
public void createPrincipal(String principal, String password) throws Exception
principal
- principal name, do not include the domain.password
- password.Exception
- thrown if the principal could not be created.public void createPrincipal(File keytabFile, String... principals) throws Exception
keytabFile
- keytab file to add the created principal.sprincipals
- principals to add to the KDC, do not include the domain.Exception
- thrown if the principals or the keytab file could not be
created.Copyright © 2015 Apache Software Foundation. All Rights Reserved.