Package sun.security.pkcs11

Examples of sun.security.pkcs11.TemplateManager$Template


        return result;
    }
   
    @Test
    public void testSimple() {
        Template t = new Template("This is a test @[foo]\n@[bar]");
        Assert.assertEquals("This is a test FOO\nBAR", t.eval(env(
                "foo", "FOO",
                "bar", "BAR")));
    }
View Full Code Here


                "bar", "BAR")));
    }
   
    @Test
    public void testJustPlaceholder() {
        Template t = new Template("@[foo]");
        Assert.assertEquals("FOO", t.eval(env(
                "foo", "FOO")));
    }
View Full Code Here

                "foo", "FOO")));
    }
   
    @Test
    public void testSimpleMissing() {
        Template t = new Template("This is a test @[foo]\n@[bar]");
        try {
            t.eval(env(
                    "foo", "FOO"));
            Assert.fail();
        } catch (RuntimeException e) {
            Assert.assertEquals("No replacement for bar at line 2", e.getMessage());
        }
        t = new Template("This is a test @[foo]\n\r\n@[bar]");
        try {
            t.eval(env(
                    "foo", "FOO"));
            Assert.fail();
        } catch (RuntimeException e) {
            Assert.assertEquals("No replacement for bar at line 3", e.getMessage());
        }
View Full Code Here

        final InputStream config = new ByteArrayInputStream(
            new StringBuilder().append("name=").append(name).append("\n")
                    .append("library=").append(library)
                    .toString().getBytes());
        Provider provider = new SunPKCS11(config);
        Security.addProvider(provider);

        final KeyStore.Builder builder = KeyStore.Builder.newInstance("PKCS11",
                provider, callbackHandlerProtection);
View Full Code Here

public class ProviderLoader {
    public static void go(final String config) throws Exception {
        AccessController.doPrivileged(new PrivilegedAction() {
            public Object run() {
                SunPKCS11 provider = new SunPKCS11(config);
                Security.addProvider(provider);
                return null;
            }
        });
    }
View Full Code Here

        }
    }

    private void parseAttributes(String keyword) throws IOException {
        if (templateManager == null) {
            templateManager = new TemplateManager();
        }
        int token = nextToken();
        if (token == '=') {
            String s = parseWord();
            if (s.equals("compatibility") == false) {
View Full Code Here

TOP

Related Classes of sun.security.pkcs11.TemplateManager$Template

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.