Class SimpleKdcServer
java.lang.Object
org.apache.kerby.kerberos.kerb.server.KdcServer
org.apache.kerby.kerberos.kerb.server.SimpleKdcServer
public class SimpleKdcServer
extends org.apache.kerby.kerberos.kerb.server.KdcServer
A simple KDC server mainly for test usage. It also integrates krb client and
kadmin sides for convenience.
-
Constructor Summary
ConstructorsConstructorDescriptionDefault constructor.SimpleKdcServer(File confDir, org.apache.kerby.kerberos.kerb.client.KrbConfig krbConfig) SimpleKdcServer(org.apache.kerby.kerberos.kerb.client.KrbConfig krbConfig) SimpleKdcServer(org.apache.kerby.kerberos.kerb.server.KdcConfig kdcConfig, org.apache.kerby.kerberos.kerb.identity.backend.BackendConfig backendConfig) -
Method Summary
Modifier and TypeMethodDescriptionvoidcreateAndExportPrincipals(File keytabFile, String... principals) Creates principals and export their keys to the specified keytab file.voidcreatePrincipal(String principal) Create principal with principal name.voidcreatePrincipal(String principal, String password) Create principal with principal name and password.voidcreatePrincipals(String... principals) Create principals.voiddeletePrincipal(String principal) Delete principal.voiddeletePrincipals(String... principals) Delete principals.voidexportPrincipal(String principal, File keytabFile) Export the keys of the specified principal into keytab file.voidexportPrincipals(File keytabFile) Export principals to keytab file.org.apache.kerby.kerberos.kerb.admin.kadmin.local.LocalKadminGet Kadmin operation interface.org.apache.kerby.kerberos.kerb.client.KrbClientGet krb client.org.apache.kerby.kerberos.kerb.client.KrbPkinitClientorg.apache.kerby.kerberos.kerb.client.KrbTokenClientvoidinit()voidsetAllowTcp(boolean allowTcp) voidsetAllowUdp(boolean allowUdp) voidsetKdcHost(String kdcHost) voidsetKdcRealm(String realm) voidsetKdcTcpPort(int kdcTcpPort) voidsetKdcUdpPort(int kdcUdpPort) voidsetWorkDir(File workDir) voidstart()voidstop()Methods inherited from class org.apache.kerby.kerberos.kerb.server.KdcServer
enableDebug, getBackendConfig, getIdentityService, getKdcConfig, getKdcPort, getKdcSetting, getKdcTcpPort, getKdcUdpPort, setInnerKdcImpl, setKdcPort
-
Constructor Details
-
SimpleKdcServer
public SimpleKdcServer() throws org.apache.kerby.kerberos.kerb.KrbExceptionDefault constructor.- Throws:
org.apache.kerby.kerberos.kerb.KrbException- e
-
SimpleKdcServer
public SimpleKdcServer(org.apache.kerby.kerberos.kerb.server.KdcConfig kdcConfig, org.apache.kerby.kerberos.kerb.identity.backend.BackendConfig backendConfig) throws org.apache.kerby.kerberos.kerb.KrbException - Throws:
org.apache.kerby.kerberos.kerb.KrbException
-
SimpleKdcServer
public SimpleKdcServer(org.apache.kerby.kerberos.kerb.client.KrbConfig krbConfig) -
SimpleKdcServer
public SimpleKdcServer(File confDir, org.apache.kerby.kerberos.kerb.client.KrbConfig krbConfig) throws org.apache.kerby.kerberos.kerb.KrbException - Throws:
org.apache.kerby.kerberos.kerb.KrbException
-
-
Method Details
-
setWorkDir
- Overrides:
setWorkDirin classorg.apache.kerby.kerberos.kerb.server.KdcServer
-
getWorkDir
-
setKdcRealm
- Overrides:
setKdcRealmin classorg.apache.kerby.kerberos.kerb.server.KdcServer
-
setKdcHost
- Overrides:
setKdcHostin classorg.apache.kerby.kerberos.kerb.server.KdcServer
-
setKdcTcpPort
public void setKdcTcpPort(int kdcTcpPort) - Overrides:
setKdcTcpPortin classorg.apache.kerby.kerberos.kerb.server.KdcServer
-
setAllowUdp
public void setAllowUdp(boolean allowUdp) - Overrides:
setAllowUdpin classorg.apache.kerby.kerberos.kerb.server.KdcServer
-
setAllowTcp
public void setAllowTcp(boolean allowTcp) - Overrides:
setAllowTcpin classorg.apache.kerby.kerberos.kerb.server.KdcServer
-
setKdcUdpPort
public void setKdcUdpPort(int kdcUdpPort) - Overrides:
setKdcUdpPortin classorg.apache.kerby.kerberos.kerb.server.KdcServer
-
init
public void init() throws org.apache.kerby.kerberos.kerb.KrbException- Overrides:
initin classorg.apache.kerby.kerberos.kerb.server.KdcServer- Throws:
org.apache.kerby.kerberos.kerb.KrbException
-
start
public void start() throws org.apache.kerby.kerberos.kerb.KrbException- Overrides:
startin classorg.apache.kerby.kerberos.kerb.server.KdcServer- Throws:
org.apache.kerby.kerberos.kerb.KrbException
-
getKrbClient
public org.apache.kerby.kerberos.kerb.client.KrbClient getKrbClient()Get krb client.- Returns:
- KrbClient
-
getPkinitClient
public org.apache.kerby.kerberos.kerb.client.KrbPkinitClient getPkinitClient()- Returns:
- PKINIT client
-
getTokenClient
public org.apache.kerby.kerberos.kerb.client.KrbTokenClient getTokenClient()- Returns:
- Token client
-
getKadmin
public org.apache.kerby.kerberos.kerb.admin.kadmin.local.LocalKadmin getKadmin()Get Kadmin operation interface.- Returns:
- Kadmin
-
createPrincipal
Create principal with principal name.- Parameters:
principal- The principal name- Throws:
org.apache.kerby.kerberos.kerb.KrbException- e
-
createPrincipal
public void createPrincipal(String principal, String password) throws org.apache.kerby.kerberos.kerb.KrbException Create principal with principal name and password.- Parameters:
principal- The principal namepassword- The password to create keys- Throws:
org.apache.kerby.kerberos.kerb.KrbException- e
-
createPrincipals
public void createPrincipals(String... principals) throws org.apache.kerby.kerberos.kerb.KrbException Create principals.- Parameters:
principals- The principal list- Throws:
org.apache.kerby.kerberos.kerb.KrbException- e
-
createAndExportPrincipals
public void createAndExportPrincipals(File keytabFile, String... principals) throws org.apache.kerby.kerberos.kerb.KrbException Creates principals and export their keys to the specified keytab file.- Parameters:
keytabFile- The keytab file to store principal keysprincipals- The principals to be create- Throws:
org.apache.kerby.kerberos.kerb.KrbException- e
-
deletePrincipals
public void deletePrincipals(String... principals) throws org.apache.kerby.kerberos.kerb.KrbException Delete principals.- Parameters:
principals- The principals to be delete- Throws:
org.apache.kerby.kerberos.kerb.KrbException- e
-
deletePrincipal
Delete principal.- Parameters:
principal- The principal to be delete- Throws:
org.apache.kerby.kerberos.kerb.KrbException- e
-
exportPrincipals
Export principals to keytab file.- Parameters:
keytabFile- The keytab file- Throws:
org.apache.kerby.kerberos.kerb.KrbException- e
-
exportPrincipal
public void exportPrincipal(String principal, File keytabFile) throws org.apache.kerby.kerberos.kerb.KrbException Export the keys of the specified principal into keytab file.- Parameters:
principal- principalkeytabFile- keytab file- Throws:
org.apache.kerby.kerberos.kerb.KrbException- e
-
stop
public void stop() throws org.apache.kerby.kerberos.kerb.KrbException- Overrides:
stopin classorg.apache.kerby.kerberos.kerb.server.KdcServer- Throws:
org.apache.kerby.kerberos.kerb.KrbException- e
-