Modifier and Type | Class and Description |
---|---|
pack-priv static class |
Modifier and Type | Field and Description |
---|---|
private static final int | |
private static final int | |
private static final int | |
private static final int | |
private final String | |
private final String | defaultRealm
Specified by system properties. |
public static final boolean | DISABLE_REFERRALS
|
public static final int | MAX_REFERRALS
|
private static Config | |
private Hashtable |
Access | Constructor and Description |
---|---|
private |
Modifier and Type | Method and Description |
---|---|
private static String | Returns: the realm if correct, or null otherwiseCheck if the provided realm is the correct realm |
public int[] | defaultEtype(String configName)
Returns all etypes specified in krb5.conf for the given configName, or all the builtin defaults. |
public static int | |
public boolean | |
private boolean | |
private String | |
public String | Returns: the value. When there are multiple values for the same key, returns the first one.null is returned if not all the keys are
defined. For example, get("libdefaults", "forwardable") will
return null if "forwardable" is not defined in [libdefaults], and
get("realms", "R", "kdc") will return null if "R" is not
defined in [realms] or "kdc" is not defined for "R".the keys, as an array from section name, sub-section names
(if any), to value name. keys)Gets the last-defined string value for the specified keys. |
private Object | |
public String | |
private int | |
public Boolean | Returns: the boolean value, or null if there is no value defined or the value does not look like a boolean value.the keys, see keys)get(String. Gets the boolean value for the specified keys. |
public String | |
public static synchronized Config | |
public int | Returns: the int value, Integer.MIN_VALUE is returned if it cannot be found or the value is not a legal integer.the keys keys)Gets the int value for the specified keys. |
private String | |
private String | Returns: the KDCthe realm for which the primary KDC is desired realm)Locate KDC using DNS |
public String | Returns: the list of KDCs separated by a space, always non nullthe realm for which the KDC list is desired realm)Returns a list of KDC's with each KDC separated by a space |
private String | |
private String | |
private Vector | |
public static int | |
private static native String | |
private static boolean | |
public void | |
private List | Returns: normalized linesthe configuration file fileName)Reads the configuration file and return normalized lines. |
private int | Returns: an numeric value represented by the stringthe String to be converted to an Integer. input)Parses a string to an integer. |
private Hashtable | parseStanzaTable(List<String>
the normalized input as return by loadConfigFile v)Parses the input lines to a hashtable. |
private static Void | readConfigFileLines(Path
the krb5.conf file, must be absolute file, List<String> the lines. Comment and empty lines are removed,
all lines trimmed, include and includedir
directives resolved, unknown directives ignored content, Set<Path> a set of Paths to check for possible infinite loop dups)Reads the lines of the configuration file. |
public static void | |
public void | |
public String | |
private static void | |
private static String | |
public boolean | useAddresses()
Check to use addresses in tickets use addresses if "no_addresses" or "noaddresses" is set to false |
private boolean | |
private boolean | |
private boolean |
BASE16_0 | back to summary |
---|---|
private static final int BASE16_0 |
BASE16_1 | back to summary |
---|---|
private static final int BASE16_1 |
BASE16_2 | back to summary |
---|---|
private static final int BASE16_2 |
BASE16_3 | back to summary |
---|---|
private static final int BASE16_3 |
defaultKDC | back to summary |
---|---|
private final String defaultKDC |
defaultRealm | back to summary |
---|---|
private final String defaultRealm Specified by system properties. Must be both null or non-null. |
DISABLE_REFERRALS | back to summary |
---|---|
public static final boolean DISABLE_REFERRALS
|
MAX_REFERRALS | back to summary |
---|---|
public static final int MAX_REFERRALS
|
singleton | back to summary |
---|---|
private static Config singleton |
stanzaTable | back to summary |
---|---|
private Hashtable<String, Object> stanzaTable |
Config | back to summary |
---|---|
private Config() throws KrbException Private constructor - can not be instantiated externally. |
checkRealm | back to summary |
---|---|
private static String checkRealm(String mapRealm) Check if the provided realm is the correct realm
|
defaultEtype | back to summary |
---|---|
public int[] defaultEtype(String configName) throws KrbException Returns all etypes specified in krb5.conf for the given configName, or all the builtin defaults. This result is always non-empty. If no etypes are found, an exception is thrown. |
duration | back to summary |
---|---|
public static int duration(String s) throws KrbException Translates a duration value into seconds. The format can be one of "h:m[:s]", "NdNhNmNs", and "N". See http://web.mit.edu/kerberos/krb5-devel/doc/basic/date_format.html#duration for definitions.
|
exists | back to summary |
---|---|
public boolean exists(String... keys) Returns true if keys exists, can be final string(s) or a sub-section
|
fileExists | back to summary |
---|---|
private boolean fileExists(String name)
|
findMacosConfigFile | back to summary |
---|---|
private String findMacosConfigFile() |
get | back to summary |
---|---|
public String get(String... keys) Gets the last-defined string value for the specified keys.
|
get0 | back to summary |
---|---|
private Object get0(String... keys)
|
getAll | back to summary |
---|---|
public String getAll(String... keys) Gets all values (at least one) for the specified keys separated by a whitespace, or null if there is no such keys. The values can either be provided on a single line, or on multiple lines using the same key. When provided on a single line, the value can be comma or space separated.
|
getBase | back to summary |
---|---|
private int getBase(int i) |
getBooleanObject | back to summary |
---|---|
public Boolean getBooleanObject(String... keys) Gets the boolean value for the specified keys. Returns TRUE if the string value is "yes", or "true", FALSE if "no", or "false", or null if otherwise or not defined. The comparison is case-insensitive.
|
getDefaultRealm | back to summary |
---|---|
public String getDefaultRealm() throws KrbException Gets default realm.
|
getInstance | back to summary |
---|---|
public static synchronized Config getInstance() throws KrbException Gets an instance of Config class. One and only one instance (the singleton) is returned.
|
getIntValue | back to summary |
---|---|
public int getIntValue(String... keys) Gets the int value for the specified keys.
|
getJavaFileName | back to summary |
---|---|
private String getJavaFileName() Gets the default Java configuration file name. If the system property "java.security.krb5.conf" is defined, we'll use its value, no matter if the file exists or not. Otherwise, we will look at $JAVA_HOME/conf/security directory with "krb5.conf" name, and return it if the file exists. The method returns null if it cannot find a Java config file. |
getKDCFromDNS | back to summary |
---|---|
private String getKDCFromDNS(String realm) throws KrbException Locate KDC using DNS |
getKDCList | back to summary |
---|---|
public String getKDCList(String realm) throws KrbException Returns a list of KDC's with each KDC separated by a space
|
getNativeFileName | back to summary |
---|---|
private String getNativeFileName() Gets the default native configuration file name. Depending on the OS type, the method returns the default native kerberos config file name, which is at windows directory with the name of "krb5.ini" for Windows, /etc/krb5/krb5.conf for Solaris, /etc/krb5.conf otherwise. Mac OSX X has a different file name. Note When the Terminal Service is started in Windows (from 2003), there are two kinds of Windows directories: A system one (say, C:\Windows), and a user-private one (say, C:\Users\Me\Windows). We will first look for krb5.ini in the user-private one. If not found, try the system one instead. This method will always return a non-null non-empty file name, even if that file does not exist. |
getRealmFromDNS | back to summary |
---|---|
private String getRealmFromDNS() throws KrbException Locate Kerberos realm using DNS
|
getString0 | back to summary |
---|---|
private Vector
|
getType | back to summary |
---|---|
public static int getType(String input) Get the etype and checksum value for the specified encryption and checksum type. |
getWindowsDirectory | back to summary |
---|---|
private static native String getWindowsDirectory(boolean isSystem) |
isMacosLionOrBetter | back to summary |
---|---|
private static boolean isMacosLionOrBetter() |
listTable | back to summary |
---|---|
public void listTable() For testing purpose. This method lists all information being parsed from the configuration file to the hashtable. |
loadConfigFile | back to summary |
---|---|
private List Reads the configuration file and return normalized lines. If the original file is: [realms] EXAMPLE.COM = { kdc = kerberos.example.com ... } ... The result will be (no indentations): { realms = { EXAMPLE.COM = { kdc = kerberos.example.com ... } } ... }
|
parseIntValue | back to summary |
---|---|
private int parseIntValue(String input) throws NumberFormatException Parses a string to an integer. The convertible strings include the string representations of positive integers, negative integers, and hex decimal integers. Valid inputs are, e.g., -1234, +1234, 0x40000.
|
parseStanzaTable | back to summary |
---|---|
private Hashtable Parses the input lines to a hashtable. The key would be section names (libdefaults, realms, domain_realms, etc), and the value would be another hashtable which contains the key-value pairs inside the section. The value of this sub-hashtable can be another hashtable containing another sub-sub-section or a non-empty vector of strings for final values (even if there is only one value defined). For top-level sections with duplicates names, their contents are merged. For sub-sections the former overwrites the latter. For final values, they are stored in a vector in their appearing order. Please note these values must appear in the same sub-section. Otherwise, the sub-section appears first should have already overridden the others. As a corner case, if the same name is used as both a section name and a value name, the first appearance decides the type. That is to say, if the first one is for a section, all latter appearances are ignored. If it's a value, latter appearances as sections are ignored, but those as values are added to the vector. The behavior described above is compatible to other krb5 implementations but it's not decumented publicly anywhere. the best practice is not to assume any kind of override functionality and only specify values for a particular key in one place.
|
readConfigFileLines | back to summary |
---|---|
private static Void readConfigFileLines(Path file, List<String> content, Set<Path> dups) throws IOException Reads the lines of the configuration file. All include and includedir directives are resolved by calling this method recursively.
|
refresh | back to summary |
---|---|
public static void refresh() throws KrbException Refresh and reload the Configuration. This could involve, for example reading the Configuration file again or getting the java.security.krb5.* system properties again. This method also tries its best to update static fields in other classes that depend on the configuration.
|
resetDefaultRealm | back to summary |
---|---|
public void resetDefaultRealm(String realm) Resets the default kdc realm. We do not need to synchronize these methods since assignments are atomic This method was useless. Kept here in case some class still calls it. |
toString | back to summary |
---|---|
public String toString() Overrides java. Doc from java. Returns a string representation of the object.
Satisfying this method's contract implies a non- |
toStringInternal | back to summary |
---|---|
private static void toStringInternal(String prefix, Object obj, StringBuffer sb) |
unquote | back to summary |
---|---|
private static String unquote(String s) |
useAddresses | back to summary |
---|---|
public boolean useAddresses() Check to use addresses in tickets use addresses if "no_addresses" or "noaddresses" is set to false |
useDNS | back to summary |
---|---|
private boolean useDNS(String name, boolean defaultValue) Check if need to use DNS to locate Kerberos services for name. If not defined, check dns_fallback, whose default value is true. |
useDNS_KDC | back to summary |
---|---|
private boolean useDNS_KDC() Check if need to use DNS to locate the KDC |
useDNS_Realm | back to summary |
---|---|
private boolean useDNS_Realm() |
Access | Constructor and Description |
---|---|
public |
Modifier and Type | Method and Description |
---|---|
public Boolean |
fileName | back to summary |
---|---|
private String fileName |
FileExistsAction | back to summary |
---|---|
public FileExistsAction(String fileName) |
run | back to summary |
---|---|
public Boolean run() Implements java. Doc from java. Performs the computation. This method will be called by
|