Class LocalKadminImpl
java.lang.Object
org.apache.kerby.kerberos.kerb.admin.kadmin.local.LocalKadminImpl
- All Implemented Interfaces:
Kadmin,LocalKadmin
The implementation of admin side admin facilities for local mode.
-
Constructor Summary
ConstructorsConstructorDescriptionLocalKadminImpl(File confDir) Construct with prepared conf dir.LocalKadminImpl(org.apache.kerby.kerberos.kerb.server.KdcConfig kdcConfig, org.apache.kerby.kerberos.kerb.identity.backend.BackendConfig backendConfig) Construct with prepared AdminServerConfig and BackendConfig.LocalKadminImpl(org.apache.kerby.kerberos.kerb.server.KdcSetting kdcSetting, org.apache.kerby.kerberos.kerb.identity.backend.IdentityBackend backend) Construct with prepared AdminServerSetting and Backend.LocalKadminImpl(org.apache.kerby.kerberos.kerb.server.ServerSetting serverSetting) -
Method Summary
Modifier and TypeMethodDescriptionvoidaddPrincipal(String principal) Add principal to backend.voidaddPrincipal(String principal, String password) Add principal to backend.voidaddPrincipal(String principal, String password, org.apache.kerby.KOptions kOptions) Add principal to backend.voidaddPrincipal(String principal, org.apache.kerby.KOptions kOptions) Add principal to backend.voidchangePassword(String principal, String newPassword) Change the password of specified principal.voidCheck the built-in principals, will throw KrbException if not exist.voidCreate build-in principals.voidDelete build-in principals.voiddeletePrincipal(String principal) Delete the principal in backend.voidexportKeytab(File keytabFile) Export all identity keys to the specified keytab file.voidexportKeytab(File keytabFile, String principal) Export all the keys of the specified principal into the specified keytab file.voidexportKeytab(File keytabFile, List<String> principals) Export all the keys of the specified principals into the specified keytab file.org.apache.kerby.kerberos.kerb.identity.backend.BackendConfigGet backend config.org.apache.kerby.kerberos.kerb.identity.backend.IdentityBackendGet identity backend.Get the kadmin principal name.org.apache.kerby.kerberos.kerb.server.KdcConfigGet kdc config.org.apache.kerby.kerberos.kerb.request.KrbIdentitygetPrincipal(String principalName) Get the identity from backend.Get all the principal names from backend.getPrincipals(String globString) Get all the principal names that meets the patternvoidmodifyPrincipal(String principal, org.apache.kerby.KOptions kOptions) Modify the principal with KOptions.voidrelease()Release any resources associated.voidremoveKeytabEntriesOf(File keytabFile, String principal) Remove all the keys of the specified principal in the specified keytab file.voidremoveKeytabEntriesOf(File keytabFile, String principal, int kvno) Remove all the keys of the specified principal with specified kvno in the specified keytab file.voidremoveOldKeytabEntriesOf(File keytabFile, String principal) Remove all the old keys of the specified principal in the specified keytab file.voidrenamePrincipal(String oldPrincipalName, String newPrincipalName) Rename the principal.intsize()get size of principalvoidupdateKeys(String principal) Update the random keys of specified principal.
-
Constructor Details
-
LocalKadminImpl
public LocalKadminImpl(org.apache.kerby.kerberos.kerb.server.KdcConfig kdcConfig, org.apache.kerby.kerberos.kerb.identity.backend.BackendConfig backendConfig) throws org.apache.kerby.kerberos.kerb.KrbException Construct with prepared AdminServerConfig and BackendConfig.- Parameters:
kdcConfig- The kdc configbackendConfig- The backend config- Throws:
org.apache.kerby.kerberos.kerb.KrbException- e
-
LocalKadminImpl
public LocalKadminImpl(org.apache.kerby.kerberos.kerb.server.ServerSetting serverSetting) throws org.apache.kerby.kerberos.kerb.KrbException - Throws:
org.apache.kerby.kerberos.kerb.KrbException
-
LocalKadminImpl
Construct with prepared conf dir.- Parameters:
confDir- The path of conf dir- Throws:
org.apache.kerby.kerberos.kerb.KrbException- e
-
LocalKadminImpl
public LocalKadminImpl(org.apache.kerby.kerberos.kerb.server.KdcSetting kdcSetting, org.apache.kerby.kerberos.kerb.identity.backend.IdentityBackend backend) Construct with prepared AdminServerSetting and Backend.- Parameters:
kdcSetting- The kdc settingbackend- The identity backend
-
-
Method Details
-
getKadminPrincipal
Description copied from interface:KadminGet the kadmin principal name.- Specified by:
getKadminPrincipalin interfaceKadmin- Returns:
- The kadmin principal name.
-
checkBuiltinPrincipals
public void checkBuiltinPrincipals() throws org.apache.kerby.kerberos.kerb.KrbExceptionDescription copied from interface:LocalKadminCheck the built-in principals, will throw KrbException if not exist.- Specified by:
checkBuiltinPrincipalsin interfaceLocalKadmin- Throws:
org.apache.kerby.kerberos.kerb.KrbException- e
-
createBuiltinPrincipals
public void createBuiltinPrincipals() throws org.apache.kerby.kerberos.kerb.KrbExceptionDescription copied from interface:LocalKadminCreate build-in principals.- Specified by:
createBuiltinPrincipalsin interfaceLocalKadmin- Throws:
org.apache.kerby.kerberos.kerb.KrbException- e
-
deleteBuiltinPrincipals
public void deleteBuiltinPrincipals() throws org.apache.kerby.kerberos.kerb.KrbExceptionDescription copied from interface:LocalKadminDelete build-in principals.- Specified by:
deleteBuiltinPrincipalsin interfaceLocalKadmin- Throws:
org.apache.kerby.kerberos.kerb.KrbException- e
-
getKdcConfig
public org.apache.kerby.kerberos.kerb.server.KdcConfig getKdcConfig()Description copied from interface:LocalKadminGet kdc config.- Specified by:
getKdcConfigin interfaceLocalKadmin- Returns:
- The kdc config.
-
getBackendConfig
public org.apache.kerby.kerberos.kerb.identity.backend.BackendConfig getBackendConfig()Description copied from interface:LocalKadminGet backend config.- Specified by:
getBackendConfigin interfaceLocalKadmin- Returns:
- The backend config.
-
getIdentityBackend
public org.apache.kerby.kerberos.kerb.identity.backend.IdentityBackend getIdentityBackend()Description copied from interface:LocalKadminGet identity backend.- Specified by:
getIdentityBackendin interfaceLocalKadmin- Returns:
- IdentityBackend
-
addPrincipal
Description copied from interface:KadminAdd principal to backend.- Specified by:
addPrincipalin interfaceKadmin- Parameters:
principal- The principal to be added into backend- Throws:
org.apache.kerby.kerberos.kerb.KrbException- e
-
addPrincipal
public void addPrincipal(String principal, org.apache.kerby.KOptions kOptions) throws org.apache.kerby.kerberos.kerb.KrbException Description copied from interface:KadminAdd principal to backend.- Specified by:
addPrincipalin interfaceKadmin- Parameters:
principal- The principal to be added into backendkOptions- The KOptions with principal info- Throws:
org.apache.kerby.kerberos.kerb.KrbException- e
-
addPrincipal
public void addPrincipal(String principal, String password) throws org.apache.kerby.kerberos.kerb.KrbException Description copied from interface:KadminAdd principal to backend.- Specified by:
addPrincipalin interfaceKadmin- Parameters:
principal- The principal to be added into backendpassword- The password to create encryption key- Throws:
org.apache.kerby.kerberos.kerb.KrbException- e
-
addPrincipal
public void addPrincipal(String principal, String password, org.apache.kerby.KOptions kOptions) throws org.apache.kerby.kerberos.kerb.KrbException Description copied from interface:KadminAdd principal to backend.- Specified by:
addPrincipalin interfaceKadmin- Parameters:
principal- The principal to be added into backendpassword- The password to create encryption keykOptions- The KOptions with principal info- Throws:
org.apache.kerby.kerberos.kerb.KrbException- e
-
exportKeytab
public void exportKeytab(File keytabFile, String principal) throws org.apache.kerby.kerberos.kerb.KrbException Description copied from interface:KadminExport all the keys of the specified principal into the specified keytab file.- Specified by:
exportKeytabin interfaceKadmin- Parameters:
keytabFile- The keytab fileprincipal- The principal name- Throws:
org.apache.kerby.kerberos.kerb.KrbException- e
-
exportKeytab
public void exportKeytab(File keytabFile, List<String> principals) throws org.apache.kerby.kerberos.kerb.KrbException Description copied from interface:KadminExport all the keys of the specified principals into the specified keytab file.- Specified by:
exportKeytabin interfaceKadmin- Parameters:
keytabFile- The keytab fileprincipals- The principal names- Throws:
org.apache.kerby.kerberos.kerb.KrbException- e
-
exportKeytab
Description copied from interface:KadminExport all identity keys to the specified keytab file.- Specified by:
exportKeytabin interfaceKadmin- Parameters:
keytabFile- The keytab file- Throws:
org.apache.kerby.kerberos.kerb.KrbException- e
-
removeKeytabEntriesOf
public void removeKeytabEntriesOf(File keytabFile, String principal) throws org.apache.kerby.kerberos.kerb.KrbException Description copied from interface:KadminRemove all the keys of the specified principal in the specified keytab file.- Specified by:
removeKeytabEntriesOfin interfaceKadmin- Parameters:
keytabFile- The keytab fileprincipal- The principal name- Throws:
org.apache.kerby.kerberos.kerb.KrbException- e
-
removeKeytabEntriesOf
public void removeKeytabEntriesOf(File keytabFile, String principal, int kvno) throws org.apache.kerby.kerberos.kerb.KrbException Description copied from interface:KadminRemove all the keys of the specified principal with specified kvno in the specified keytab file.- Specified by:
removeKeytabEntriesOfin interfaceKadmin- Parameters:
keytabFile- The keytab fileprincipal- The principal namekvno- The kvno- Throws:
org.apache.kerby.kerberos.kerb.KrbException- e
-
removeOldKeytabEntriesOf
public void removeOldKeytabEntriesOf(File keytabFile, String principal) throws org.apache.kerby.kerberos.kerb.KrbException Description copied from interface:KadminRemove all the old keys of the specified principal in the specified keytab file.- Specified by:
removeOldKeytabEntriesOfin interfaceKadmin- Parameters:
keytabFile- The keytab fileprincipal- The principal name- Throws:
org.apache.kerby.kerberos.kerb.KrbException- e
-
deletePrincipal
Description copied from interface:KadminDelete the principal in backend.- Specified by:
deletePrincipalin interfaceKadmin- Parameters:
principal- The principal to be deleted from backend- Throws:
org.apache.kerby.kerberos.kerb.KrbException- e
-
modifyPrincipal
public void modifyPrincipal(String principal, org.apache.kerby.KOptions kOptions) throws org.apache.kerby.kerberos.kerb.KrbException Description copied from interface:KadminModify the principal with KOptions.- Specified by:
modifyPrincipalin interfaceKadmin- Parameters:
principal- The principal to be modifiedkOptions- The KOptions with changed principal info- Throws:
org.apache.kerby.kerberos.kerb.KrbException- e
-
renamePrincipal
public void renamePrincipal(String oldPrincipalName, String newPrincipalName) throws org.apache.kerby.kerberos.kerb.KrbException Description copied from interface:KadminRename the principal.- Specified by:
renamePrincipalin interfaceKadmin- Parameters:
oldPrincipalName- The original principal namenewPrincipalName- The new principal name- Throws:
org.apache.kerby.kerberos.kerb.KrbException- e
-
getPrincipal
public org.apache.kerby.kerberos.kerb.request.KrbIdentity getPrincipal(String principalName) throws org.apache.kerby.kerberos.kerb.KrbException Description copied from interface:LocalKadminGet the identity from backend.- Specified by:
getPrincipalin interfaceLocalKadmin- Parameters:
principalName- The principal name- Returns:
- identity
- Throws:
org.apache.kerby.kerberos.kerb.KrbException- e
-
getPrincipals
Description copied from interface:KadminGet all the principal names from backend.- Specified by:
getPrincipalsin interfaceKadmin- Returns:
- principal list
- Throws:
org.apache.kerby.kerberos.kerb.KrbException- e
-
getPrincipals
public List<String> getPrincipals(String globString) throws org.apache.kerby.kerberos.kerb.KrbException Description copied from interface:KadminGet all the principal names that meets the pattern- Specified by:
getPrincipalsin interfaceKadmin- Parameters:
globString- The glob string for matching- Returns:
- Principal names
- Throws:
org.apache.kerby.kerberos.kerb.KrbException- e
-
changePassword
public void changePassword(String principal, String newPassword) throws org.apache.kerby.kerberos.kerb.KrbException Description copied from interface:KadminChange the password of specified principal.- Specified by:
changePasswordin interfaceKadmin- Parameters:
principal- The principal to be updated passwordnewPassword- The new password- Throws:
org.apache.kerby.kerberos.kerb.KrbException- e
-
updateKeys
Description copied from interface:KadminUpdate the random keys of specified principal.- Specified by:
updateKeysin interfaceKadmin- Parameters:
principal- The principal to be updated keys- Throws:
org.apache.kerby.kerberos.kerb.KrbException- e
-
release
public void release() throws org.apache.kerby.kerberos.kerb.KrbExceptionDescription copied from interface:KadminRelease any resources associated. -
size
public int size() throws org.apache.kerby.kerberos.kerb.KrbExceptionget size of principal- Specified by:
sizein interfaceLocalKadmin- Throws:
org.apache.kerby.kerberos.kerb.KrbException
-