Code example for ECParameterSpec

Methods: getCofactorgetCurvegetGeneratorgetOrder

0
        assertEquals(expected.getS(), actual.getS());
        assertECParametersEquals(expected.getParams(), actual.getParams());
    } 
 
    private static void assertECParametersEquals(ECParameterSpec expected, ECParameterSpec actual) {
        assertEquals(expected.getCurve(), actual.getCurve());
        assertEquals(expected.getGenerator(), actual.getGenerator());
        assertEquals(expected.getOrder(), actual.getOrder());
        assertEquals(expected.getCofactor(), actual.getCofactor());
    } 
 
    /** 
     * DH parameters pre-generated so that the test doesn't take too long. 
     * These parameters were generated with: 
     * 
     * openssl gendh 512 | openssl dhparams -C 
     */ 
    private static AlgorithmParameterSpec getDHParams() {
        BigInteger p = new BigInteger("E7AB1768BD75CD24700960FFA32D3F1557344E587101237532CC641646ED7A7C104743377F6D46251698B665CE2A6CBAB6714C2569A7D2CA22C0CF03FA40AC93", 16);
        BigInteger g = new BigInteger("02", 16);
        return new DHParameterSpec(p, g, 512);