public class MiniKdc
extends java.lang.Object
From within testcases:
MiniKdc sets one System property when started and un-set when stopped:
MiniKdc default configuration values are:
| Modifier and Type | Field | Description |
|---|---|---|
static java.lang.String |
DEBUG |
|
static java.lang.String |
INSTANCE |
|
static java.lang.String |
JAVA_SECURITY_KRB5_CONF |
|
static java.lang.String |
KDC_BIND_ADDRESS |
|
static java.lang.String |
KDC_PORT |
|
static java.lang.String |
MAX_RENEWABLE_LIFETIME |
|
static java.lang.String |
MAX_TICKET_LIFETIME |
|
static java.lang.String |
MIN_TICKET_LIFETIME |
|
static java.lang.String |
ORG_DOMAIN |
|
static java.lang.String |
ORG_NAME |
|
static java.lang.String |
SUN_SECURITY_KRB5_DEBUG |
|
static java.lang.String |
TRANSPORT |
| Constructor | Description |
|---|---|
MiniKdc(java.util.Properties conf,
java.io.File workDir) |
Creates a MiniKdc.
|
| Modifier and Type | Method | Description |
|---|---|---|
static java.util.Properties |
createConf() |
Convenience method that returns MiniKdc default configuration.
|
void |
createPrincipal(java.io.File keytabFile,
java.lang.String... principals) |
Creates multiple principals in the KDC and adds them to a keytab file.
|
void |
createPrincipal(java.lang.String principal,
java.lang.String password) |
Creates a principal in the KDC with the specified user and password.
|
java.lang.String |
getHost() |
Returns the host of the MiniKdc.
|
java.io.File |
getKrb5conf() |
|
int |
getPort() |
Returns the port of the MiniKdc.
|
java.lang.String |
getRealm() |
Returns the realm of the MiniKdc.
|
static void |
main(java.lang.String[] args) |
|
void |
setTransport(java.lang.String transport) |
|
void |
start() |
Starts the MiniKdc.
|
void |
stop() |
Stops the MiniKdc
|
public static final java.lang.String JAVA_SECURITY_KRB5_CONF
public static final java.lang.String SUN_SECURITY_KRB5_DEBUG
public static final java.lang.String ORG_NAME
public static final java.lang.String ORG_DOMAIN
public static final java.lang.String KDC_BIND_ADDRESS
public static final java.lang.String KDC_PORT
public static final java.lang.String INSTANCE
public static final java.lang.String MAX_TICKET_LIFETIME
public static final java.lang.String MIN_TICKET_LIFETIME
public static final java.lang.String MAX_RENEWABLE_LIFETIME
public static final java.lang.String TRANSPORT
public static final java.lang.String DEBUG
public MiniKdc(java.util.Properties conf,
java.io.File workDir)
throws java.lang.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.java.lang.Exception - thrown if the MiniKdc could not be created.public static void main(java.lang.String[] args)
throws java.lang.Exception
java.lang.Exceptionpublic static java.util.Properties createConf()
The returned configuration is a copy, it can be customized before using it to create a MiniKdc.
public void setTransport(java.lang.String transport)
public int getPort()
public java.lang.String getHost()
public java.lang.String getRealm()
public java.io.File getKrb5conf()
public void start()
throws java.lang.Exception
java.lang.Exception - thrown if the MiniKdc could not be started.public void stop()
public void createPrincipal(java.lang.String principal,
java.lang.String password)
throws java.lang.Exception
principal - principal name, do not include the domain.password - password.java.lang.Exception - thrown if the principal could not be created.public void createPrincipal(java.io.File keytabFile,
java.lang.String... principals)
throws java.lang.Exception
keytabFile - keytab file to add the created principals.principals - principals to add to the KDC, do not include the domain.java.lang.Exception - thrown if the principals or the keytab file could not be
created.Copyright © 2008–2025 Apache Software Foundation. All rights reserved.