public static KrbClient newClient( String krb5ConfFilename ) throws IOException, KrbException { KrbConfig krbConfig = new KrbConfig(); if ( krb5ConfFilename != null ) { krbConfig.addKrb5Config( new File( krb5ConfFilename ) ); } KrbClient krbClient = new KrbClient( krbConfig ); krbClient.init(); return krbClient; }
/** * Get KDC host name * * @return The kdc host */ public String getKdcHost() { return getString( KrbConfigKey.KDC_HOST, true, LIBDEFAULT); }
public boolean allowTcp() { Boolean allowTcp = commonOptions.getBooleanOption( KrbOption.ALLOW_TCP, krbConfig.allowTcp()); return allowTcp; }
public SimpleKdcServer(KdcConfig kdcConfig, BackendConfig backendConfig) throws KrbException { super(kdcConfig, backendConfig); this.krbClnt = new KrbClient(new KrbConfig()); setKdcRealm("EXAMPLE.COM"); setKdcHost("localhost"); setKdcPort(NetworkUtil.getServerPort()); }
public List<EncryptionType> getEncryptionTypes() { List<EncryptionType> encryptionTypes = krbContext.getConfig().getEncryptionTypes(); return EncryptionUtil.orderEtypesByStrength(encryptionTypes); } }
public boolean allowUdp() { Boolean allowUdp = commonOptions.getBooleanOption( KrbOption.ALLOW_UDP, krbConfig.allowUdp()); return allowUdp; }
ApRep apRep = readRep( decodedApRep, key, krbClient.getKrbConfig().getAllowableClockSkew(), apReq, addressInfo.getClientAddress() ); KrbPriv sessionInfoPriv = readPriv( decodedSessionInfoPriv, key, addressInfo.getServerAddress(), addressInfo.getClientAddress(), krbClient.getKrbConfig().getAllowableClockSkew(), apRep ); EncKrbPrivPart encKrbPrivPart = sessionInfoPriv.getEncPart(); byte[] userData = encKrbPrivPart.getUserData();
public SimpleKdcServer(KdcConfig kdcConfig, BackendConfig backendConfig) throws KrbException { super(kdcConfig, backendConfig); this.krbClnt = new KrbClient(new KrbConfig()); setKdcRealm("EXAMPLE.COM"); setKdcHost("localhost"); setKdcPort(NetworkUtil.getServerPort()); }
public List<EncryptionType> getEncryptionTypes() { if (encryptionTypes == null) { encryptionTypes = context.getConfig().getEncryptionTypes(); } return EncryptionUtil.orderEtypesByStrength(encryptionTypes); }
public boolean allowUdp() { Boolean allowUdp = commonOptions.getBooleanOption( KrbOption.ALLOW_UDP, krbConfig.allowUdp()); return allowUdp; }
/** * Load krb5.conf from specified conf dir. * @param conf The conf file or dir, default file name 'krb5.conf' is used if dir * @return KrbConfig * @throws KrbException e */ public static KrbConfig getConfig(File conf) throws KrbException { if (!conf.exists()) { throw new KrbException(conf + " not found"); } File confFile = conf.isDirectory() ? new File(conf, KRB5_FILE_NAME) : conf; if (!confFile.exists()) { throw new KrbException(KRB5_FILE_NAME + " not found"); } if (confFile != null && confFile.exists()) { KrbConfig krbConfig = new KrbConfig(); try { krbConfig.addKrb5Config(confFile); return krbConfig; } catch (IOException e) { throw new KrbException("Failed to load krb config " + confFile.getAbsolutePath()); } } return null; }
/** * Default constructor. * * @throws org.apache.kerby.kerberos.kerb.KrbException e */ public SimpleKdcServer() throws KrbException { this(new KrbConfig()); setKdcRealm("EXAMPLE.COM"); setKdcHost("localhost"); setKdcPort(NetworkUtil.getServerPort()); }
/** * Get tgs principal. * @return The tgs principal */ public String getTgsPrincipal() { return getString(KrbConfigKey.TGS_PRINCIPAL, true, LIBDEFAULT); }
public List<EncryptionType> getEncryptionTypes() { if (encryptionTypes == null) { encryptionTypes = context.getConfig().getEncryptionTypes(); } return EncryptionUtil.orderEtypesByStrength(encryptionTypes); }
public boolean allowTcp() { Boolean allowTcp = commonOptions.getBooleanOption( KrbOption.ALLOW_TCP, krbConfig.allowTcp()); return allowTcp; }
/** * Load krb5.conf from specified conf dir. * @param conf The conf file or dir, default file name 'krb5.conf' is used if dir * @return KrbConfig * @throws KrbException e */ public static KrbConfig getConfig(File conf) throws KrbException { if (!conf.exists()) { throw new KrbException(conf + " not found"); } File confFile = conf.isDirectory() ? new File(conf, KRB5_FILE_NAME) : conf; if (!confFile.exists()) { throw new KrbException(KRB5_FILE_NAME + " not found"); } if (confFile != null && confFile.exists()) { KrbConfig krbConfig = new KrbConfig(); try { krbConfig.addKrb5Config(confFile); return krbConfig; } catch (IOException e) { throw new KrbException("Failed to load krb config " + confFile.getAbsolutePath()); } } return null; }
/** * Default constructor. * * @throws org.apache.kerby.kerberos.kerb.KrbException e */ public SimpleKdcServer() throws KrbException { this(new KrbConfig()); setKdcRealm("EXAMPLE.COM"); setKdcHost("localhost"); setKdcPort(NetworkUtil.getServerPort()); }