Code example for ECParameterSpec

Methods: getCofactor

        ECPoint generator = new ECPoint(BigInteger.ZERO, BigInteger.valueOf(2L));
        BigInteger order = BigInteger.valueOf(5L);
        int cofactor = 10;
        ECParameterSpec ps = 
            new ECParameterSpec(curve, generator, order, cofactor);
        assertEquals(cofactor, ps.getCofactor());
     * Test for <code>getCurve()</code> method<br> 
     * Assertion: returns curve<br> 
     * Test preconditions: <code>ECParameterSpec</code> instance 
     * created using valid parameters<br> 
     * Expected: must return ref to the <code>EllipticCurve</code> object 
     * which is equal to the one passed to the constructor; (both must refer 
     * the same object) 
    public final void testGetCurve() { 
        // Valid (see note below) parameters set