32
33 import java.security.*;
34
35 import sun.security.action.GetPropertyAction;
36 import sun.security.util.PropertyExpander;
37
38 /**
39 * Configuration container and file parsing.
40 *
41 * Currently, there is only one supported entry "disabledServices"
42 * for disabling crypto services. Its syntax is as follows:
43 *
44 * disabledServices = {
45 * <ServiceType>.<Algorithm>
46 * ...
47 * }
48 *
49 * where <Service> can be "MessageDigest", "Cipher", etc. and <Algorithm>
50 * reprepresents the value that's passed into the various getInstance() calls.
51 *
52 * @since 1.9
53 */
54 final class Config {
55
56 // Reader and StringTokenizer used during parsing
57 private Reader reader;
58
59 private StreamTokenizer st;
60
61 private Set<String> parsedKeywords;
62
63 // set of disabled crypto services, e.g. MessageDigest.SHA1, or
64 // Cipher.AES/ECB/PKCS5Padding
65 private Set<String> disabledServices;
66
67 Config(String filename) throws IOException {
68 FileInputStream in = new FileInputStream(expand(filename));
69 reader = new BufferedReader(new InputStreamReader(in));
70 parsedKeywords = new HashSet<String>();
71 st = new StreamTokenizer(reader);
72 setupTokenizer();
|
32
33 import java.security.*;
34
35 import sun.security.action.GetPropertyAction;
36 import sun.security.util.PropertyExpander;
37
38 /**
39 * Configuration container and file parsing.
40 *
41 * Currently, there is only one supported entry "disabledServices"
42 * for disabling crypto services. Its syntax is as follows:
43 *
44 * disabledServices = {
45 * <ServiceType>.<Algorithm>
46 * ...
47 * }
48 *
49 * where <Service> can be "MessageDigest", "Cipher", etc. and <Algorithm>
50 * reprepresents the value that's passed into the various getInstance() calls.
51 *
52 * @since 9
53 */
54 final class Config {
55
56 // Reader and StringTokenizer used during parsing
57 private Reader reader;
58
59 private StreamTokenizer st;
60
61 private Set<String> parsedKeywords;
62
63 // set of disabled crypto services, e.g. MessageDigest.SHA1, or
64 // Cipher.AES/ECB/PKCS5Padding
65 private Set<String> disabledServices;
66
67 Config(String filename) throws IOException {
68 FileInputStream in = new FileInputStream(expand(filename));
69 reader = new BufferedReader(new InputStreamReader(in));
70 parsedKeywords = new HashSet<String>();
71 st = new StreamTokenizer(reader);
72 setupTokenizer();
|