Class LocalKadminImpl

java.lang.Object
org.apache.kerby.kerberos.kerb.admin.kadmin.local.LocalKadminImpl
All Implemented Interfaces:
Kadmin, LocalKadmin

public class LocalKadminImpl extends Object implements LocalKadmin
The implementation of admin side admin facilities for local mode.
  • 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 config
      backendConfig - 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

      public LocalKadminImpl(File confDir) throws org.apache.kerby.kerberos.kerb.KrbException
      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 setting
      backend - The identity backend
  • Method Details

    • getKadminPrincipal

      public String getKadminPrincipal()
      Description copied from interface: Kadmin
      Get the kadmin principal name.
      Specified by:
      getKadminPrincipal in interface Kadmin
      Returns:
      The kadmin principal name.
    • checkBuiltinPrincipals

      public void checkBuiltinPrincipals() throws org.apache.kerby.kerberos.kerb.KrbException
      Description copied from interface: LocalKadmin
      Check the built-in principals, will throw KrbException if not exist.
      Specified by:
      checkBuiltinPrincipals in interface LocalKadmin
      Throws:
      org.apache.kerby.kerberos.kerb.KrbException - e
    • createBuiltinPrincipals

      public void createBuiltinPrincipals() throws org.apache.kerby.kerberos.kerb.KrbException
      Description copied from interface: LocalKadmin
      Create build-in principals.
      Specified by:
      createBuiltinPrincipals in interface LocalKadmin
      Throws:
      org.apache.kerby.kerberos.kerb.KrbException - e
    • deleteBuiltinPrincipals

      public void deleteBuiltinPrincipals() throws org.apache.kerby.kerberos.kerb.KrbException
      Description copied from interface: LocalKadmin
      Delete build-in principals.
      Specified by:
      deleteBuiltinPrincipals in interface LocalKadmin
      Throws:
      org.apache.kerby.kerberos.kerb.KrbException - e
    • getKdcConfig

      public org.apache.kerby.kerberos.kerb.server.KdcConfig getKdcConfig()
      Description copied from interface: LocalKadmin
      Get kdc config.
      Specified by:
      getKdcConfig in interface LocalKadmin
      Returns:
      The kdc config.
    • getBackendConfig

      public org.apache.kerby.kerberos.kerb.identity.backend.BackendConfig getBackendConfig()
      Description copied from interface: LocalKadmin
      Get backend config.
      Specified by:
      getBackendConfig in interface LocalKadmin
      Returns:
      The backend config.
    • getIdentityBackend

      public org.apache.kerby.kerberos.kerb.identity.backend.IdentityBackend getIdentityBackend()
      Description copied from interface: LocalKadmin
      Get identity backend.
      Specified by:
      getIdentityBackend in interface LocalKadmin
      Returns:
      IdentityBackend
    • addPrincipal

      public void addPrincipal(String principal) throws org.apache.kerby.kerberos.kerb.KrbException
      Description copied from interface: Kadmin
      Add principal to backend.
      Specified by:
      addPrincipal in interface Kadmin
      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: Kadmin
      Add principal to backend.
      Specified by:
      addPrincipal in interface Kadmin
      Parameters:
      principal - The principal to be added into backend
      kOptions - 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: Kadmin
      Add principal to backend.
      Specified by:
      addPrincipal in interface Kadmin
      Parameters:
      principal - The principal to be added into backend
      password - 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: Kadmin
      Add principal to backend.
      Specified by:
      addPrincipal in interface Kadmin
      Parameters:
      principal - The principal to be added into backend
      password - The password to create encryption key
      kOptions - 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: Kadmin
      Export all the keys of the specified principal into the specified keytab file.
      Specified by:
      exportKeytab in interface Kadmin
      Parameters:
      keytabFile - The keytab file
      principal - 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: Kadmin
      Export all the keys of the specified principals into the specified keytab file.
      Specified by:
      exportKeytab in interface Kadmin
      Parameters:
      keytabFile - The keytab file
      principals - The principal names
      Throws:
      org.apache.kerby.kerberos.kerb.KrbException - e
    • exportKeytab

      public void exportKeytab(File keytabFile) throws org.apache.kerby.kerberos.kerb.KrbException
      Description copied from interface: Kadmin
      Export all identity keys to the specified keytab file.
      Specified by:
      exportKeytab in interface Kadmin
      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: Kadmin
      Remove all the keys of the specified principal in the specified keytab file.
      Specified by:
      removeKeytabEntriesOf in interface Kadmin
      Parameters:
      keytabFile - The keytab file
      principal - 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: Kadmin
      Remove all the keys of the specified principal with specified kvno in the specified keytab file.
      Specified by:
      removeKeytabEntriesOf in interface Kadmin
      Parameters:
      keytabFile - The keytab file
      principal - The principal name
      kvno - 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: Kadmin
      Remove all the old keys of the specified principal in the specified keytab file.
      Specified by:
      removeOldKeytabEntriesOf in interface Kadmin
      Parameters:
      keytabFile - The keytab file
      principal - The principal name
      Throws:
      org.apache.kerby.kerberos.kerb.KrbException - e
    • deletePrincipal

      public void deletePrincipal(String principal) throws org.apache.kerby.kerberos.kerb.KrbException
      Description copied from interface: Kadmin
      Delete the principal in backend.
      Specified by:
      deletePrincipal in interface Kadmin
      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: Kadmin
      Modify the principal with KOptions.
      Specified by:
      modifyPrincipal in interface Kadmin
      Parameters:
      principal - The principal to be modified
      kOptions - 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: Kadmin
      Rename the principal.
      Specified by:
      renamePrincipal in interface Kadmin
      Parameters:
      oldPrincipalName - The original principal name
      newPrincipalName - 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: LocalKadmin
      Get the identity from backend.
      Specified by:
      getPrincipal in interface LocalKadmin
      Parameters:
      principalName - The principal name
      Returns:
      identity
      Throws:
      org.apache.kerby.kerberos.kerb.KrbException - e
    • getPrincipals

      public List<String> getPrincipals() throws org.apache.kerby.kerberos.kerb.KrbException
      Description copied from interface: Kadmin
      Get all the principal names from backend.
      Specified by:
      getPrincipals in interface Kadmin
      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: Kadmin
      Get all the principal names that meets the pattern
      Specified by:
      getPrincipals in interface Kadmin
      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: Kadmin
      Change the password of specified principal.
      Specified by:
      changePassword in interface Kadmin
      Parameters:
      principal - The principal to be updated password
      newPassword - The new password
      Throws:
      org.apache.kerby.kerberos.kerb.KrbException - e
    • updateKeys

      public void updateKeys(String principal) throws org.apache.kerby.kerberos.kerb.KrbException
      Description copied from interface: Kadmin
      Update the random keys of specified principal.
      Specified by:
      updateKeys in interface Kadmin
      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.KrbException
      Description copied from interface: Kadmin
      Release any resources associated.
      Specified by:
      release in interface Kadmin
      Throws:
      org.apache.kerby.kerberos.kerb.KrbException - e
    • size

      public int size() throws org.apache.kerby.kerberos.kerb.KrbException
      get size of principal
      Specified by:
      size in interface LocalKadmin
      Throws:
      org.apache.kerby.kerberos.kerb.KrbException