Examples of ECGenParameterSpec


Examples of java.security.spec.ECGenParameterSpec

     *
     * Assertion: returns the <code>name</code> 
     */
    public final void testGetName() {
        String name = "someName";
        ECGenParameterSpec ps = new ECGenParameterSpec(name);
        assertEquals(name, ps.getName());
    }
View Full Code Here

Examples of java.security.spec.ECGenParameterSpec

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

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

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

Examples of java.security.spec.ECGenParameterSpec

        private static String getCurveName(ECParameterSpec spec)
            throws GeneralSecurityException
        {
            AlgorithmParameters ap = AlgorithmParameters.getInstance("EC");
            ap.init(spec);
            ECGenParameterSpec nameSpec =
                ap.getParameterSpec(ECGenParameterSpec.class);
            if (nameSpec == null) {
                return null;
            }
            return nameSpec.getName();
        }
View Full Code Here

Examples of java.security.spec.ECGenParameterSpec

        private static ECParameterSpec getECParameterSpec(String name)
            throws GeneralSecurityException
        {
            AlgorithmParameters ap = AlgorithmParameters.getInstance("EC");
            ap.init(new ECGenParameterSpec(name));
            return ap.getParameterSpec(ECParameterSpec.class);
        }
View Full Code Here

Examples of java.security.spec.ECGenParameterSpec

    public CreateInteropXMLDSig11Test() throws Exception {
        // Create KeyPairs
        try {
            KeyPairGenerator kpg = KeyPairGenerator.getInstance("EC");
            kpg.initialize(new ECGenParameterSpec("1.2.840.10045.3.1.7"));
            p256 = kpg.generateKeyPair();
            kpg.initialize(new ECGenParameterSpec("1.3.132.0.34"));
            p384 = kpg.generateKeyPair();
            kpg.initialize(new ECGenParameterSpec("1.3.132.0.35"));
            p521 = kpg.generateKeyPair();
        } catch (NoSuchAlgorithmException nsae) {
            // EC not supported on this platform
            ecSupport = false;
        }
View Full Code Here

Examples of java.security.spec.ECGenParameterSpec

     *
     * 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

Examples of java.security.spec.ECGenParameterSpec

     * 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

Examples of java.security.spec.ECGenParameterSpec

     *
     * Assertion: returns the <code>name</code> 
     */
    public final void testGetName() {
        String name = "someName";
        ECGenParameterSpec ps = new ECGenParameterSpec(name);
        assertEquals(name, ps.getName());
    }
View Full Code Here

Examples of java.security.spec.ECGenParameterSpec

    public CreateInteropXMLDSig11Test() throws Exception {
        // Create KeyPairs
        try {
            KeyPairGenerator kpg = KeyPairGenerator.getInstance("EC");
            kpg.initialize(new ECGenParameterSpec("1.2.840.10045.3.1.7"));
            p256 = kpg.generateKeyPair();
            kpg.initialize(new ECGenParameterSpec("1.3.132.0.34"));
            p384 = kpg.generateKeyPair();
            kpg.initialize(new ECGenParameterSpec("1.3.132.0.35"));
            p521 = kpg.generateKeyPair();
        } catch (NoSuchAlgorithmException nsae) {
            // EC not supported on this platform
            ecSupport = false;
        }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.