org.apache.kerby.kerberos.kerb.keytab.Keytab.<init>()方法的使用及代码示例

x33g5p2x  于2022-01-24 转载在 其他  
字(2.3k)|赞(0)|评价(0)|浏览(105)

本文整理了Java中org.apache.kerby.kerberos.kerb.keytab.Keytab.<init>()方法的一些代码示例,展示了Keytab.<init>()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Keytab.<init>()方法的具体详情如下:
包路径:org.apache.kerby.kerberos.kerb.keytab.Keytab
类名称:Keytab
方法名:<init>

Keytab.<init>介绍

暂无

代码示例

代码示例来源:origin: apache/directory-kerby

public static Keytab loadKeytab(File keytabFile) throws IOException {
  Keytab keytab = new Keytab();
  keytab.load(keytabFile);
  return keytab;
}

代码示例来源:origin: org.apache.kerby/kerb-util

public static Keytab loadKeytab(File keytabFile) throws IOException {
  Keytab keytab = new Keytab();
  keytab.load(keytabFile);
  return keytab;
}

代码示例来源:origin: org.apache.kerby/kerb-util

public static Keytab loadKeytab(InputStream inputStream) throws IOException {
  Keytab keytab = new Keytab();
  keytab.load(inputStream);
  return keytab;
}

代码示例来源:origin: apache/directory-kerby

public static Keytab loadKeytab(InputStream inputStream) throws IOException {
  Keytab keytab = new Keytab();
  keytab.load(inputStream);
  return keytab;
}

代码示例来源:origin: org.apache.kerby/kerb-admin

/**
 * If keytab file does not exist, create a new keytab,
 * otherwise load keytab from keytab file.
 *
 * @param keytabFile The keytab file
 * @return The keytab load from keytab file
 * @throws KrbException If there is a problem creating or loading the keytab
 */
public static Keytab createOrLoadKeytab(File keytabFile) throws KrbException {
  Keytab keytab;
  try {
    if (!keytabFile.exists()) {
      if (!keytabFile.createNewFile()) {
        throw new KrbException("Failed to create keytab file "
            + keytabFile.getAbsolutePath());
      }
      keytab = new Keytab();
    } else {
      keytab = Keytab.loadKeytab(keytabFile);
    }
  } catch (IOException e) {
    throw new KrbException("Failed to load or create keytab "
      + keytabFile.getAbsolutePath(), e);
  }
  return keytab;
}

代码示例来源:origin: apache/directory-kerby

/**
 * If keytab file does not exist, create a new keytab,
 * otherwise load keytab from keytab file.
 *
 * @param keytabFile The keytab file
 * @return The keytab load from keytab file
 * @throws KrbException If there is a problem creating or loading the keytab
 */
public static Keytab createOrLoadKeytab(File keytabFile) throws KrbException {
  Keytab keytab;
  try {
    if (!keytabFile.exists()) {
      if (!keytabFile.createNewFile()) {
        throw new KrbException("Failed to create keytab file "
            + keytabFile.getAbsolutePath());
      }
      keytab = new Keytab();
    } else {
      keytab = Keytab.loadKeytab(keytabFile);
    }
  } catch (IOException e) {
    throw new KrbException("Failed to load or create keytab "
      + keytabFile.getAbsolutePath(), e);
  }
  return keytab;
}

相关文章