sun.security.util.PolicyUtil Java Examples
The following examples show how to use
sun.security.util.PolicyUtil.
You can vote up the ones you like or vote down the ones you don't like,
and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: AuthPolicyFile.java From dragonwell8_jdk with GNU General Public License v2.0 | 5 votes |
/** * Reads a policy configuration into the Policy object using a * Reader object. * * @param policyFile the policy Reader object. */ private void init(URL policy) { PolicyParser pp = new PolicyParser(expandProperties); try (InputStreamReader isr = new InputStreamReader(PolicyUtil.getInputStream(policy))) { pp.read(isr); KeyStore keyStore = initKeyStore(policy, pp.getKeyStoreUrl(), pp.getKeyStoreType()); Enumeration<GrantEntry> enum_ = pp.grantElements(); while (enum_.hasMoreElements()) { GrantEntry ge = enum_.nextElement(); addGrantEntry(ge, keyStore); } } catch (PolicyParser.ParsingException pe) { System.err.println(AUTH_POLICY + rb.getString(".error.parsing.") + policy); System.err.println(AUTH_POLICY + rb.getString("COLON") + pe.getMessage()); if (debug != null) { pe.printStackTrace(); } } catch (Exception e) { if (debug != null) { debug.println("error parsing " + policy); debug.println(e.toString()); e.printStackTrace(); } } }
Example #2
Source File: AuthPolicyFile.java From TencentKona-8 with GNU General Public License v2.0 | 5 votes |
/** * Reads a policy configuration into the Policy object using a * Reader object. * * @param policyFile the policy Reader object. */ private void init(URL policy) { PolicyParser pp = new PolicyParser(expandProperties); try (InputStreamReader isr = new InputStreamReader(PolicyUtil.getInputStream(policy))) { pp.read(isr); KeyStore keyStore = initKeyStore(policy, pp.getKeyStoreUrl(), pp.getKeyStoreType()); Enumeration<GrantEntry> enum_ = pp.grantElements(); while (enum_.hasMoreElements()) { GrantEntry ge = enum_.nextElement(); addGrantEntry(ge, keyStore); } } catch (PolicyParser.ParsingException pe) { System.err.println(AUTH_POLICY + rb.getString(".error.parsing.") + policy); System.err.println(AUTH_POLICY + rb.getString("COLON") + pe.getMessage()); if (debug != null) { pe.printStackTrace(); } } catch (Exception e) { if (debug != null) { debug.println("error parsing " + policy); debug.println(e.toString()); e.printStackTrace(); } } }
Example #3
Source File: AuthPolicyFile.java From jdk8u60 with GNU General Public License v2.0 | 5 votes |
/** * Reads a policy configuration into the Policy object using a * Reader object. * * @param policyFile the policy Reader object. */ private void init(URL policy) { PolicyParser pp = new PolicyParser(expandProperties); try (InputStreamReader isr = new InputStreamReader(PolicyUtil.getInputStream(policy))) { pp.read(isr); KeyStore keyStore = initKeyStore(policy, pp.getKeyStoreUrl(), pp.getKeyStoreType()); Enumeration<GrantEntry> enum_ = pp.grantElements(); while (enum_.hasMoreElements()) { GrantEntry ge = enum_.nextElement(); addGrantEntry(ge, keyStore); } } catch (PolicyParser.ParsingException pe) { System.err.println(AUTH_POLICY + rb.getString(".error.parsing.") + policy); System.err.println(AUTH_POLICY + rb.getString("COLON") + pe.getMessage()); if (debug != null) { pe.printStackTrace(); } } catch (Exception e) { if (debug != null) { debug.println("error parsing " + policy); debug.println(e.toString()); e.printStackTrace(); } } }
Example #4
Source File: AuthPolicyFile.java From openjdk-jdk8u with GNU General Public License v2.0 | 5 votes |
/** * Reads a policy configuration into the Policy object using a * Reader object. * * @param policyFile the policy Reader object. */ private void init(URL policy) { PolicyParser pp = new PolicyParser(expandProperties); try (InputStreamReader isr = new InputStreamReader(PolicyUtil.getInputStream(policy))) { pp.read(isr); KeyStore keyStore = initKeyStore(policy, pp.getKeyStoreUrl(), pp.getKeyStoreType()); Enumeration<GrantEntry> enum_ = pp.grantElements(); while (enum_.hasMoreElements()) { GrantEntry ge = enum_.nextElement(); addGrantEntry(ge, keyStore); } } catch (PolicyParser.ParsingException pe) { System.err.println(AUTH_POLICY + rb.getString(".error.parsing.") + policy); System.err.println(AUTH_POLICY + rb.getString("COLON") + pe.getMessage()); if (debug != null) { pe.printStackTrace(); } } catch (Exception e) { if (debug != null) { debug.println("error parsing " + policy); debug.println(e.toString()); e.printStackTrace(); } } }
Example #5
Source File: AuthPolicyFile.java From openjdk-jdk8u-backup with GNU General Public License v2.0 | 5 votes |
/** * Reads a policy configuration into the Policy object using a * Reader object. * * @param policyFile the policy Reader object. */ private void init(URL policy) { PolicyParser pp = new PolicyParser(expandProperties); try (InputStreamReader isr = new InputStreamReader(PolicyUtil.getInputStream(policy))) { pp.read(isr); KeyStore keyStore = initKeyStore(policy, pp.getKeyStoreUrl(), pp.getKeyStoreType()); Enumeration<GrantEntry> enum_ = pp.grantElements(); while (enum_.hasMoreElements()) { GrantEntry ge = enum_.nextElement(); addGrantEntry(ge, keyStore); } } catch (PolicyParser.ParsingException pe) { System.err.println(AUTH_POLICY + rb.getString(".error.parsing.") + policy); System.err.println(AUTH_POLICY + rb.getString("COLON") + pe.getMessage()); if (debug != null) { pe.printStackTrace(); } } catch (Exception e) { if (debug != null) { debug.println("error parsing " + policy); debug.println(e.toString()); e.printStackTrace(); } } }
Example #6
Source File: AuthPolicyFile.java From openjdk-jdk9 with GNU General Public License v2.0 | 5 votes |
/** * Reads a policy configuration into the Policy object using a * Reader object. * * @param policyFile the policy Reader object. */ private void init(URL policy) { PolicyParser pp = new PolicyParser(expandProperties); try (InputStreamReader isr = new InputStreamReader(PolicyUtil.getInputStream(policy))) { pp.read(isr); KeyStore keyStore = initKeyStore(policy, pp.getKeyStoreUrl(), pp.getKeyStoreType()); Enumeration<GrantEntry> enum_ = pp.grantElements(); while (enum_.hasMoreElements()) { GrantEntry ge = enum_.nextElement(); addGrantEntry(ge, keyStore); } } catch (PolicyParser.ParsingException pe) { System.err.println(AUTH_POLICY + rb.getString(".error.parsing.") + policy); System.err.println(AUTH_POLICY + rb.getString("COLON") + pe.getMessage()); if (debug != null) { pe.printStackTrace(); } } catch (Exception e) { if (debug != null) { debug.println("error parsing " + policy); debug.println(e.toString()); e.printStackTrace(); } } }
Example #7
Source File: AuthPolicyFile.java From jdk8u-jdk with GNU General Public License v2.0 | 5 votes |
/** * Reads a policy configuration into the Policy object using a * Reader object. * * @param policyFile the policy Reader object. */ private void init(URL policy) { PolicyParser pp = new PolicyParser(expandProperties); try (InputStreamReader isr = new InputStreamReader(PolicyUtil.getInputStream(policy))) { pp.read(isr); KeyStore keyStore = initKeyStore(policy, pp.getKeyStoreUrl(), pp.getKeyStoreType()); Enumeration<GrantEntry> enum_ = pp.grantElements(); while (enum_.hasMoreElements()) { GrantEntry ge = enum_.nextElement(); addGrantEntry(ge, keyStore); } } catch (PolicyParser.ParsingException pe) { System.err.println(AUTH_POLICY + rb.getString(".error.parsing.") + policy); System.err.println(AUTH_POLICY + rb.getString("COLON") + pe.getMessage()); if (debug != null) { pe.printStackTrace(); } } catch (Exception e) { if (debug != null) { debug.println("error parsing " + policy); debug.println(e.toString()); e.printStackTrace(); } } }
Example #8
Source File: AuthPolicyFile.java From hottub with GNU General Public License v2.0 | 5 votes |
/** * Reads a policy configuration into the Policy object using a * Reader object. * * @param policyFile the policy Reader object. */ private void init(URL policy) { PolicyParser pp = new PolicyParser(expandProperties); try (InputStreamReader isr = new InputStreamReader(PolicyUtil.getInputStream(policy))) { pp.read(isr); KeyStore keyStore = initKeyStore(policy, pp.getKeyStoreUrl(), pp.getKeyStoreType()); Enumeration<GrantEntry> enum_ = pp.grantElements(); while (enum_.hasMoreElements()) { GrantEntry ge = enum_.nextElement(); addGrantEntry(ge, keyStore); } } catch (PolicyParser.ParsingException pe) { System.err.println(AUTH_POLICY + rb.getString(".error.parsing.") + policy); System.err.println(AUTH_POLICY + rb.getString("COLON") + pe.getMessage()); if (debug != null) { pe.printStackTrace(); } } catch (Exception e) { if (debug != null) { debug.println("error parsing " + policy); debug.println(e.toString()); e.printStackTrace(); } } }
Example #9
Source File: AuthPolicyFile.java From openjdk-8-source with GNU General Public License v2.0 | 5 votes |
/** * Reads a policy configuration into the Policy object using a * Reader object. * * @param policyFile the policy Reader object. */ private void init(URL policy) { PolicyParser pp = new PolicyParser(expandProperties); try (InputStreamReader isr = new InputStreamReader(PolicyUtil.getInputStream(policy))) { pp.read(isr); KeyStore keyStore = initKeyStore(policy, pp.getKeyStoreUrl(), pp.getKeyStoreType()); Enumeration<GrantEntry> enum_ = pp.grantElements(); while (enum_.hasMoreElements()) { GrantEntry ge = enum_.nextElement(); addGrantEntry(ge, keyStore); } } catch (PolicyParser.ParsingException pe) { System.err.println(AUTH_POLICY + rb.getString(".error.parsing.") + policy); System.err.println(AUTH_POLICY + rb.getString("COLON") + pe.getMessage()); if (debug != null) { pe.printStackTrace(); } } catch (Exception e) { if (debug != null) { debug.println("error parsing " + policy); debug.println(e.toString()); e.printStackTrace(); } } }
Example #10
Source File: AuthPolicyFile.java From openjdk-8 with GNU General Public License v2.0 | 5 votes |
/** * Reads a policy configuration into the Policy object using a * Reader object. * * @param policyFile the policy Reader object. */ private void init(URL policy) { PolicyParser pp = new PolicyParser(expandProperties); try (InputStreamReader isr = new InputStreamReader(PolicyUtil.getInputStream(policy))) { pp.read(isr); KeyStore keyStore = initKeyStore(policy, pp.getKeyStoreUrl(), pp.getKeyStoreType()); Enumeration<GrantEntry> enum_ = pp.grantElements(); while (enum_.hasMoreElements()) { GrantEntry ge = enum_.nextElement(); addGrantEntry(ge, keyStore); } } catch (PolicyParser.ParsingException pe) { System.err.println(AUTH_POLICY + rb.getString(".error.parsing.") + policy); System.err.println(AUTH_POLICY + rb.getString("COLON") + pe.getMessage()); if (debug != null) { pe.printStackTrace(); } } catch (Exception e) { if (debug != null) { debug.println("error parsing " + policy); debug.println(e.toString()); e.printStackTrace(); } } }
Example #11
Source File: AuthPolicyFile.java From jdk8u_jdk with GNU General Public License v2.0 | 5 votes |
/** * Reads a policy configuration into the Policy object using a * Reader object. * * @param policyFile the policy Reader object. */ private void init(URL policy) { PolicyParser pp = new PolicyParser(expandProperties); try (InputStreamReader isr = new InputStreamReader(PolicyUtil.getInputStream(policy))) { pp.read(isr); KeyStore keyStore = initKeyStore(policy, pp.getKeyStoreUrl(), pp.getKeyStoreType()); Enumeration<GrantEntry> enum_ = pp.grantElements(); while (enum_.hasMoreElements()) { GrantEntry ge = enum_.nextElement(); addGrantEntry(ge, keyStore); } } catch (PolicyParser.ParsingException pe) { System.err.println(AUTH_POLICY + rb.getString(".error.parsing.") + policy); System.err.println(AUTH_POLICY + rb.getString("COLON") + pe.getMessage()); if (debug != null) { pe.printStackTrace(); } } catch (Exception e) { if (debug != null) { debug.println("error parsing " + policy); debug.println(e.toString()); e.printStackTrace(); } } }
Example #12
Source File: AuthPolicyFile.java From jdk8u-jdk with GNU General Public License v2.0 | 5 votes |
/** * Reads a policy configuration into the Policy object using a * Reader object. * * @param policyFile the policy Reader object. */ private void init(URL policy) { PolicyParser pp = new PolicyParser(expandProperties); try (InputStreamReader isr = new InputStreamReader(PolicyUtil.getInputStream(policy))) { pp.read(isr); KeyStore keyStore = initKeyStore(policy, pp.getKeyStoreUrl(), pp.getKeyStoreType()); Enumeration<GrantEntry> enum_ = pp.grantElements(); while (enum_.hasMoreElements()) { GrantEntry ge = enum_.nextElement(); addGrantEntry(ge, keyStore); } } catch (PolicyParser.ParsingException pe) { System.err.println(AUTH_POLICY + rb.getString(".error.parsing.") + policy); System.err.println(AUTH_POLICY + rb.getString("COLON") + pe.getMessage()); if (debug != null) { pe.printStackTrace(); } } catch (Exception e) { if (debug != null) { debug.println("error parsing " + policy); debug.println(e.toString()); e.printStackTrace(); } } }
Example #13
Source File: AuthPolicyFile.java From jdk8u-dev-jdk with GNU General Public License v2.0 | 5 votes |
/** * Reads a policy configuration into the Policy object using a * Reader object. * * @param policyFile the policy Reader object. */ private void init(URL policy) { PolicyParser pp = new PolicyParser(expandProperties); try (InputStreamReader isr = new InputStreamReader(PolicyUtil.getInputStream(policy))) { pp.read(isr); KeyStore keyStore = initKeyStore(policy, pp.getKeyStoreUrl(), pp.getKeyStoreType()); Enumeration<GrantEntry> enum_ = pp.grantElements(); while (enum_.hasMoreElements()) { GrantEntry ge = enum_.nextElement(); addGrantEntry(ge, keyStore); } } catch (PolicyParser.ParsingException pe) { System.err.println(AUTH_POLICY + rb.getString(".error.parsing.") + policy); System.err.println(AUTH_POLICY + rb.getString("COLON") + pe.getMessage()); if (debug != null) { pe.printStackTrace(); } } catch (Exception e) { if (debug != null) { debug.println("error parsing " + policy); debug.println(e.toString()); e.printStackTrace(); } } }