@Override
  protected Keytab createKeytab(String principal, String password, Integer keyNumber)
      throws KerberosOperationException {

    if ((principal == null) || principal.isEmpty()) {
      throw new KerberosOperationException("Failed to create keytab file, missing principal");
    }

    // use cache if available
    if (cachedKeytabs.containsKey(principal)) {
      return cachedKeytabs.get(principal);
    }

    File keytabFile = null;

    try {
      try {
        keytabFile = File.createTempFile("ambari_tmp", ".keytab");

        // Remove the file else the command will fail...
        if (!keytabFile.delete()) {
          LOG.warn("Failed to remove temporary file to hold keytab.  Exporting the keytab file for {} may fail.", principal);
        }
      } catch (IOException e) {
        throw new KerberosOperationException(String.format("Failed to create the temporary file needed to hold the exported keytab file for %s: %s", principal, e.getLocalizedMessage()), e);
      }


      exportKeytabFile(principal, keytabFile.getAbsolutePath(), getKeyEncryptionTypes());

      Keytab keytab = readKeytabFile(keytabFile);
      cachedKeytabs.put(principal, keytab);
      return keytab;
    } finally {
      if ((keytabFile != null) && keytabFile.exists()) {
        if (!keytabFile.delete()) {
          LOG.debug("Failed to remove the temporary keytab file, {}", keytabFile.getAbsolutePath());
        }
      }
    }
  }
Creates a key tab by using the ipa commandline utilities. It ignores key number and password
as this will be handled by IPA

@param principal a String containing the principal to test
@param password  (IGNORED) a String containing the password to use when creating the principal
@param keyNumber (IGNORED) a Integer indicating the key number for the keytab entries
@return the created Keytab
@throws KerberosOperationException
ambari-server/src/main/java/org/apache/ambari/server/serveraction/kerberos/KDCKerberosOperationHandler.java