public static Keytab loadKeytab(File keytabFile) throws IOException { Keytab keytab = new Keytab(); keytab.load(keytabFile); return keytab; }
public static Keytab loadKeytab(File keytabFile) throws IOException { Keytab keytab = new Keytab(); keytab.load(keytabFile); return keytab; }
public static Keytab loadKeytab(InputStream inputStream) throws IOException { Keytab keytab = new Keytab(); keytab.load(inputStream); return keytab; }
public static Keytab loadKeytab(InputStream inputStream) throws IOException { Keytab keytab = new Keytab(); keytab.load(inputStream); return keytab; }
/** * 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; }
/** * 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; }