Java Security get(Configuration configuration, String section, String key)

Here you can find the source of get(Configuration configuration, String section, String key)

Description

get

License

Apache License

Declaration

public static String get(Configuration configuration, String section,
            String key) throws IOException 

Method Source Code

//package com.java2s;
//License from project: Apache License 

import javax.security.auth.login.Configuration;
import javax.security.auth.login.AppConfigurationEntry;

import java.io.IOException;

public class Main {
    public static String get(Configuration configuration, String section,
            String key) throws IOException {
        AppConfigurationEntry configurationEntries[] = configuration
                .getAppConfigurationEntry(section);
        if (configurationEntries == null) {
            String errorMessage = "Could not find a '" + section
                    + "' entry in this configuration.";
            throw new IOException(errorMessage);
        }/*from   www.j av  a  2 s. c  om*/

        for (AppConfigurationEntry entry : configurationEntries) {
            Object val = entry.getOptions().get(key);
            if (val != null)
                return (String) val;
        }
        return null;
    }
}

Related

  1. cloneKerberosTicket(KerberosTicket kerberosTicket)
  2. convertLegacyToRFC2253(String dn)
  3. credsToTicket(Credentials serviceCreds)
  4. extractDirective(HashMap map, String key, String value)
  5. filterMechs(String[] mechs, int[] policies, Map props)
  6. getCommonName(String name)
  7. getDirectiveValue( HashMap directivesMap, String directive, boolean mandatory)
  8. getEntries(Configuration configuration, String section)
  9. getPublicCredential(Class type, Subject subject)