public List<EncryptionType> getEncryptionTypes() { List<EncryptionType> encryptionTypes = krbContext.getConfig().getEncryptionTypes(); return EncryptionUtil.orderEtypesByStrength(encryptionTypes); } }
public List<EncryptionType> getEncryptionTypes() { List<EncryptionType> encryptionTypes = krbContext.getConfig().getEncryptionTypes(); return EncryptionUtil.orderEtypesByStrength(encryptionTypes); } }
public List<EncryptionType> getEncryptionTypes() { if (encryptionTypes == null) { encryptionTypes = context.getConfig().getEncryptionTypes(); } return EncryptionUtil.orderEtypesByStrength(encryptionTypes); }
/** * Get ticket valid time. * @return The ticket valid time */ public long getTicketValidTime() { String ticketValidTimeStr = getConfig().getTicketLifetime(); long ticketValidTime = KOptions.parseDuration(ticketValidTimeStr); return ticketValidTime * 1000; }
public List<EncryptionType> getEncryptionTypes() { if (encryptionTypes == null) { encryptionTypes = context.getConfig().getEncryptionTypes(); } return EncryptionUtil.orderEtypesByStrength(encryptionTypes); }
/** * Get ticket valid time. * @return The ticket valid time */ public long getTicketValidTime() { String ticketValidTimeStr = getConfig().getTicketLifetime(); long ticketValidTime = KOptions.parseDuration(ticketValidTimeStr); return ticketValidTime * 1000; }
private Keytab getKeytab() { File keytabFile = null; KOptions kOptions = getRequestOptions(); if (kOptions.contains(KrbOption.KEYTAB_FILE)) { keytabFile = kOptions.getFileOption(KrbOption.KEYTAB_FILE); } if (kOptions.contains(KrbOption.USE_DFT_KEYTAB)) { final String clientKeytabEnv = System.getenv("KRB5_CLIENT_KTNAME"); final String clientKeytabDft = getContext().getConfig().getString( "default_client_keytab_name"); if (clientKeytabEnv != null) { keytabFile = new File(clientKeytabEnv); } else if (clientKeytabDft != null) { keytabFile = new File(clientKeytabDft); } else { System.err.println("Default client keytab file not found."); } } Keytab keytab = null; try { keytab = Keytab.loadKeytab(keytabFile); } catch (IOException e) { System.err.println("Can not load keytab from file" + keytabFile.getAbsolutePath()); } return keytab; }
private Keytab getKeytab() { File keytabFile = null; KOptions kOptions = getRequestOptions(); if (kOptions.contains(KrbOption.KEYTAB_FILE)) { keytabFile = kOptions.getFileOption(KrbOption.KEYTAB_FILE); } if (kOptions.contains(KrbOption.USE_DFT_KEYTAB)) { final String clientKeytabEnv = System.getenv("KRB5_CLIENT_KTNAME"); final String clientKeytabDft = getContext().getConfig().getString( "default_client_keytab_name"); if (clientKeytabEnv != null) { keytabFile = new File(clientKeytabEnv); } else if (clientKeytabDft != null) { keytabFile = new File(clientKeytabDft); } else { System.err.println("Default client keytab file not found."); } } Keytab keytab = null; try { keytab = Keytab.loadKeytab(keytabFile); } catch (IOException e) { System.err.println("Can not load keytab from file" + keytabFile.getAbsolutePath()); } return keytab; }
public PreauthContext preparePreauthContext(KdcRequest kdcRequest) { PreauthContext preauthContext = new PreauthContext(); preauthContext.setPreauthRequired(krbContext.getConfig().isPreauthRequired()); for (KrbPreauth preauth : preauths) { PreauthHandle handle = new PreauthHandle(preauth); handle.initRequestContext(kdcRequest); preauthContext.getHandles().add(handle); } return preauthContext; }
public PreauthContext preparePreauthContext(KdcRequest kdcRequest) { PreauthContext preauthContext = new PreauthContext(); preauthContext.setPreauthRequired(krbContext.getConfig().isPreauthRequired()); for (KrbPreauth preauth : preauths) { PreauthHandle handle = new PreauthHandle(preauth); handle.initRequestContext(kdcRequest); preauthContext.getHandles().add(handle); } return preauthContext; }
CmsMessageType.CMS_SIGN_SERVER, signedData); if (kdcRequest.getContext().getConfig().getPkinitAnchors().isEmpty()) { LOG.error("No PKINIT anchors specified"); throw new KrbException("No PKINIT anchors specified"); String anchorFileName = kdcRequest.getContext().getConfig().getPkinitAnchors().get(0); kdcRequest.getContext().getConfig().getKdcRealm()); kdcRequest.getContext().getConfig().getPkinitKdcHostName(), kdcPrincipal, certificates); if (!validSan) {
CmsMessageType.CMS_SIGN_SERVER, signedData); if (kdcRequest.getContext().getConfig().getPkinitAnchors().isEmpty()) { LOG.error("No PKINIT anchors specified"); throw new KrbException("No PKINIT anchors specified"); String anchorFileName = kdcRequest.getContext().getConfig().getPkinitAnchors().get(0); kdcRequest.getContext().getConfig().getKdcRealm()); kdcRequest.getContext().getConfig().getPkinitKdcHostName(), kdcPrincipal, certificates); if (!validSan) {
/** * {@inheritDoc} */ @Override public void setPreauthOptions(KdcRequest kdcRequest, PluginRequestContext requestContext, KOptions options) { if (options.contains(PkinitOption.X509_IDENTITY)) { pkinitContext.getIdentityOpts().setIdentity(options.getStringOption(PkinitOption.X509_IDENTITY)); } if (options.contains(PkinitOption.X509_ANCHORS)) { String anchorsString = options.getStringOption(PkinitOption.X509_ANCHORS); List<String> anchors; if (anchorsString == null) { anchors = kdcRequest.getContext().getConfig().getPkinitAnchors(); } else { anchors = Arrays.asList(anchorsString); } pkinitContext.getIdentityOpts().getAnchors().addAll(anchors); } if (options.contains(PkinitOption.USING_RSA)) { pkinitContext.getPluginOpts().setUsingRsa(options.getBooleanOption(PkinitOption.USING_RSA, true)); } }
/** * {@inheritDoc} */ @Override public void setPreauthOptions(KdcRequest kdcRequest, PluginRequestContext requestContext, KOptions options) { if (options.contains(PkinitOption.X509_IDENTITY)) { pkinitContext.getIdentityOpts().setIdentity(options.getStringOption(PkinitOption.X509_IDENTITY)); } if (options.contains(PkinitOption.X509_ANCHORS)) { String anchorsString = options.getStringOption(PkinitOption.X509_ANCHORS); List<String> anchors; if (anchorsString == null) { anchors = kdcRequest.getContext().getConfig().getPkinitAnchors(); } else { anchors = Arrays.asList(anchorsString); } pkinitContext.getIdentityOpts().getAnchors().addAll(anchors); } if (options.contains(PkinitOption.USING_RSA)) { pkinitContext.getPluginOpts().setUsingRsa(options.getBooleanOption(PkinitOption.USING_RSA, true)); } }