Package java.security.spec

Examples of java.security.spec.ECGenParameterSpec


    public void testECDSA(
        String name)
        throws Exception
    {
        ECGenParameterSpec     ecSpec = new ECGenParameterSpec(name);
        if (ecSpec == null)
        {
            fail("no curve for " + name + " found.");
        }
View Full Code Here


    public void testECGOST(
        String name)
        throws Exception
    {
        ECGenParameterSpec     ecSpec = new ECGenParameterSpec(name);

        if (ecSpec == null)
        {
            fail("no curve for " + name + " found.");
        }
View Full Code Here

        path.delete();

        // Generate
        SimpleGeneratorHostKeyProvider provider = new SimpleGeneratorHostKeyProvider();
        provider.setAlgorithm("EC");
        provider.setKeySpec(new ECGenParameterSpec("prime256v1"));
        provider.setPath(path.getPath());
        assertEquals(KeyPairProvider.ECDSA_SHA2_NISTP256, provider.getKeyTypes());
        assertNotNull(provider.loadKey(KeyPairProvider.ECDSA_SHA2_NISTP256));

        // Read existing
        provider = new SimpleGeneratorHostKeyProvider();
        provider.setAlgorithm("EC");
        provider.setKeySpec(new ECGenParameterSpec("prime256v1"));
        provider.setPath(path.getPath());
        assertEquals(KeyPairProvider.ECDSA_SHA2_NISTP256, provider.getKeyTypes());
        assertNotNull(provider.loadKey(KeyPairProvider.ECDSA_SHA2_NISTP256));
    }
View Full Code Here

        path.delete();

        // Generate
        SimpleGeneratorHostKeyProvider provider = new SimpleGeneratorHostKeyProvider();
        provider.setAlgorithm("EC");
        provider.setKeySpec(new ECGenParameterSpec("P-384"));
        provider.setPath(path.getPath());
        assertEquals(KeyPairProvider.ECDSA_SHA2_NISTP384, provider.getKeyTypes());
        assertNotNull(provider.loadKey(KeyPairProvider.ECDSA_SHA2_NISTP384));

        // Read existing
        provider = new SimpleGeneratorHostKeyProvider();
        provider.setAlgorithm("EC");
        provider.setKeySpec(new ECGenParameterSpec("P-384"));
        provider.setPath(path.getPath());
        assertEquals(KeyPairProvider.ECDSA_SHA2_NISTP384, provider.getKeyTypes());
        assertNotNull(provider.loadKey(KeyPairProvider.ECDSA_SHA2_NISTP384));
    }
View Full Code Here

        path.delete();

        // Generate
        SimpleGeneratorHostKeyProvider provider = new SimpleGeneratorHostKeyProvider();
        provider.setAlgorithm("EC");
        provider.setKeySpec(new ECGenParameterSpec("P-521"));
        provider.setPath(path.getPath());
        assertEquals(KeyPairProvider.ECDSA_SHA2_NISTP521, provider.getKeyTypes());
        assertNotNull(provider.loadKey(KeyPairProvider.ECDSA_SHA2_NISTP521));

        // Read existing
        provider = new SimpleGeneratorHostKeyProvider();
        provider.setAlgorithm("EC");
        provider.setKeySpec(new ECGenParameterSpec("P-521"));
        provider.setPath(path.getPath());
        assertEquals(KeyPairProvider.ECDSA_SHA2_NISTP521, provider.getKeyTypes());
        assertNotNull(provider.loadKey(KeyPairProvider.ECDSA_SHA2_NISTP521));
    }
View Full Code Here

        path.delete();

        // Generate
        PEMGeneratorHostKeyProvider provider = new PEMGeneratorHostKeyProvider();
        provider.setAlgorithm("EC");
        provider.setKeySpec(new ECGenParameterSpec("prime256v1"));
        provider.setPath(path.getPath());
        assertEquals(KeyPairProvider.ECDSA_SHA2_NISTP256, provider.getKeyTypes());
        KeyPair pk1 = provider.loadKey(KeyPairProvider.ECDSA_SHA2_NISTP256);
        assertNotNull(pk1);

        // Read existing
        provider = new PEMGeneratorHostKeyProvider();
        provider.setAlgorithm("EC");
        provider.setKeySpec(new ECGenParameterSpec("prime256v1"));
        provider.setPath(path.getPath());
        assertEquals(KeyPairProvider.ECDSA_SHA2_NISTP256, provider.getKeyTypes());
        KeyPair pk2 = provider.loadKey(KeyPairProvider.ECDSA_SHA2_NISTP256);
        assertNotNull(pk2);
View Full Code Here

        path.delete();

        // Generate
        PEMGeneratorHostKeyProvider provider = new PEMGeneratorHostKeyProvider();
        provider.setAlgorithm("EC");
        provider.setKeySpec(new ECGenParameterSpec("P-384"));
        provider.setPath(path.getPath());
        assertEquals(KeyPairProvider.ECDSA_SHA2_NISTP384, provider.getKeyTypes());
        KeyPair pk1 = provider.loadKey(KeyPairProvider.ECDSA_SHA2_NISTP384);
        assertNotNull(pk1);

        // Read existing
        provider = new PEMGeneratorHostKeyProvider();
        provider.setAlgorithm("EC");
        provider.setKeySpec(new ECGenParameterSpec("P-384"));
        provider.setPath(path.getPath());
        assertEquals(KeyPairProvider.ECDSA_SHA2_NISTP384, provider.getKeyTypes());
        KeyPair pk2 = provider.loadKey(KeyPairProvider.ECDSA_SHA2_NISTP384);
        assertNotNull(pk2);
View Full Code Here

        path.delete();

        // Generate
        PEMGeneratorHostKeyProvider provider = new PEMGeneratorHostKeyProvider();
        provider.setAlgorithm("EC");
        provider.setKeySpec(new ECGenParameterSpec("P-521"));
        provider.setPath(path.getPath());
        assertEquals(KeyPairProvider.ECDSA_SHA2_NISTP521, provider.getKeyTypes());
        KeyPair pk1 = provider.loadKey(KeyPairProvider.ECDSA_SHA2_NISTP521);
        assertNotNull(pk1);

        // Read existing
        provider = new PEMGeneratorHostKeyProvider();
        provider.setAlgorithm("EC");
        provider.setKeySpec(new ECGenParameterSpec("P-521"));
        provider.setPath(path.getPath());
        assertEquals(KeyPairProvider.ECDSA_SHA2_NISTP521, provider.getKeyTypes());
        KeyPair pk2 = provider.loadKey(KeyPairProvider.ECDSA_SHA2_NISTP521);
        assertNotNull(pk2);
View Full Code Here

     *
     * Assertion: creates new object of <code>ECGenParameterSpec</code> class
     * using valid <code>name</code>
     */
    public final void testECGenParameterSpec01() {
        new ECGenParameterSpec("someName");
    }
View Full Code Here

     * Assertion: throws NullPointerException
     * if <code>name</code> is <code>null</code> 
     */
    public final void testECGenParameterSpec02() {
        try {
            new ECGenParameterSpec(null);
            fail("NPE expected");
        } catch (NullPointerException ok) {}
    }
View Full Code Here

TOP

Related Classes of java.security.spec.ECGenParameterSpec

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.