Class AdminHelper
java.lang.Object
org.apache.kerby.kerberos.kerb.admin.kadmin.local.AdminHelper
LocalKadmin utilities.
-
Method Summary
Modifier and TypeMethodDescriptionstatic org.apache.kerby.kerberos.kerb.request.KrbIdentitycreateIdentity(String principal, org.apache.kerby.KOptions kOptions) Create principal.static org.apache.kerby.kerberos.kerb.keytab.KeytabcreateOrLoadKeytab(File keytabFile) If keytab file does not exist, create a new keytab, otherwise load keytab from keytab file.static voidexportKeytab(File keytabFile, List<org.apache.kerby.kerberos.kerb.request.KrbIdentity> identities) Export all the keys of the specified principal into the specified keytab file.static voidexportKeytab(File keytabFile, org.apache.kerby.kerberos.kerb.request.KrbIdentity identity) Export all the keys of the specified principal into the specified keytab file.static voidexportToKeytab(org.apache.kerby.kerberos.kerb.keytab.Keytab keytab, org.apache.kerby.kerberos.kerb.request.KrbIdentity identity) Export all the keys of the specified identity into the keytab.static PatterngetPatternFromGlobPatternString(String globString) Get all the Pattern for matching from glob string.static org.apache.kerby.kerberos.kerb.keytab.KeytabloadKeytab(File keytabFile) Load keytab from keytab file.static org.apache.kerby.kerberos.kerb.keytab.KeytabloadKeytab(InputStream keytabInputStream) Load keytab from Input stream.static voidremoveKeytabEntriesOf(File keytabFile, String principalName) Remove all the keys of the specified principal in the specified keytab file.static voidremoveOldKeytabEntriesOf(File keytabFile, String principalName) Remove all the old keys of the specified principal in the specified keytab file.static voidstoreKeytab(org.apache.kerby.kerberos.kerb.keytab.Keytab keytab, File keytabFile) Store the keytab to keytab file.static voidupdateIdentity(org.apache.kerby.kerberos.kerb.request.KrbIdentity identity, org.apache.kerby.KOptions kOptions) Modify the principal with KOptions.
-
Method Details
-
exportKeytab
public static void exportKeytab(File keytabFile, org.apache.kerby.kerberos.kerb.request.KrbIdentity identity) throws org.apache.kerby.kerberos.kerb.KrbException Export all the keys of the specified principal into the specified keytab file.- Parameters:
keytabFile- The keytab fileidentity- The identity- Throws:
org.apache.kerby.kerberos.kerb.KrbException- If there is a problem exporting the keys of the specified principal
-
exportKeytab
public static void exportKeytab(File keytabFile, List<org.apache.kerby.kerberos.kerb.request.KrbIdentity> identities) throws org.apache.kerby.kerberos.kerb.KrbException Export all the keys of the specified principal into the specified keytab file.- Parameters:
keytabFile- The keytab fileidentities- Identities to export to keytabFile- Throws:
org.apache.kerby.kerberos.kerb.KrbException- If there is a problem exporting the keys of the specified principal
-
loadKeytab
public static org.apache.kerby.kerberos.kerb.keytab.Keytab loadKeytab(File keytabFile) throws org.apache.kerby.kerberos.kerb.KrbException Load keytab from keytab file.- Parameters:
keytabFile- The keytab file- Returns:
- The keytab load from keytab file
- Throws:
org.apache.kerby.kerberos.kerb.KrbException- If there is a problem loading the keytab
-
loadKeytab
public static org.apache.kerby.kerberos.kerb.keytab.Keytab loadKeytab(InputStream keytabInputStream) throws org.apache.kerby.kerberos.kerb.KrbException Load keytab from Input stream.- Parameters:
keytabInputStream- The Input stream- Returns:
- The keytab load from keytab file
- Throws:
org.apache.kerby.kerberos.kerb.KrbException- If there is a problem loading the Input stream
-
createOrLoadKeytab
public static org.apache.kerby.kerberos.kerb.keytab.Keytab createOrLoadKeytab(File keytabFile) throws org.apache.kerby.kerberos.kerb.KrbException If keytab file does not exist, create a new keytab, otherwise load keytab from keytab file.- Parameters:
keytabFile- The keytab file- Returns:
- The keytab load from keytab file
- Throws:
org.apache.kerby.kerberos.kerb.KrbException- If there is a problem creating or loading the keytab
-
exportToKeytab
public static void exportToKeytab(org.apache.kerby.kerberos.kerb.keytab.Keytab keytab, org.apache.kerby.kerberos.kerb.request.KrbIdentity identity) throws org.apache.kerby.kerberos.kerb.KrbException Export all the keys of the specified identity into the keytab.- Parameters:
keytab- The keytabidentity- The identity- Throws:
org.apache.kerby.kerberos.kerb.KrbException- If there is a problem exporting the identity to the keytab
-
storeKeytab
public static void storeKeytab(org.apache.kerby.kerberos.kerb.keytab.Keytab keytab, File keytabFile) throws org.apache.kerby.kerberos.kerb.KrbException Store the keytab to keytab file.- Parameters:
keytab- The keytabkeytabFile- The keytab file- Throws:
org.apache.kerby.kerberos.kerb.KrbException- If there is a problem storing the keytab
-
removeKeytabEntriesOf
public static void removeKeytabEntriesOf(File keytabFile, String principalName) throws org.apache.kerby.kerberos.kerb.KrbException Remove all the keys of the specified principal in the specified keytab file.- Parameters:
keytabFile- The keytab fileprincipalName- The principal name- Throws:
org.apache.kerby.kerberos.kerb.KrbException- If there is a problem removing the keys of the specified principal
-
removeOldKeytabEntriesOf
public static void removeOldKeytabEntriesOf(File keytabFile, String principalName) throws org.apache.kerby.kerberos.kerb.KrbException Remove all the old keys of the specified principal in the specified keytab file.- Parameters:
keytabFile- The keytab fileprincipalName- The principal name- Throws:
org.apache.kerby.kerberos.kerb.KrbException- If there is a problem in removing the old keys of the specified principal
-
createIdentity
public static org.apache.kerby.kerberos.kerb.request.KrbIdentity createIdentity(String principal, org.apache.kerby.KOptions kOptions) throws org.apache.kerby.kerberos.kerb.KrbException Create principal.- Parameters:
principal- The principal name to be createdkOptions- The KOptions with principal info- Returns:
- the created principal identity
- Throws:
org.apache.kerby.kerberos.kerb.KrbException- If there is a problem in creating the principal
-
updateIdentity
public static void updateIdentity(org.apache.kerby.kerberos.kerb.request.KrbIdentity identity, org.apache.kerby.KOptions kOptions) Modify the principal with KOptions.- Parameters:
identity- The identity to be modifiedkOptions- The KOptions with changed principal info
-
getPatternFromGlobPatternString
public static Pattern getPatternFromGlobPatternString(String globString) throws org.apache.kerby.kerberos.kerb.KrbException Get all the Pattern for matching from glob string. The glob string can contain "." "*" and "[]"- Parameters:
globString- The glob string for matching- Returns:
- pattern
- Throws:
org.apache.kerby.kerberos.kerb.KrbException- If there is a problem in compiling the pattern string
-