Package java.security.spec

Examples of java.security.spec.ECPoint


        // Valid (see note below) parameters set
        EllipticCurve c =
            new EllipticCurve(new ECFieldFp(BigInteger.valueOf(5L)),
                              BigInteger.ZERO,
                              BigInteger.valueOf(4L));
        ECPoint g = new ECPoint(BigInteger.ZERO, BigInteger.valueOf(2L));
        ECParameterSpec params =
            new ECParameterSpec(c, g, BigInteger.valueOf(5L), 10);

        ECPrivateKeySpec ks = new ECPrivateKeySpec(BigInteger.ZERO, params);
        ECParameterSpec paramsRet = ks.getParams();
View Full Code Here


        // Valid (see note below) parameters set
        EllipticCurve c =
            new EllipticCurve(new ECFieldFp(BigInteger.valueOf(5L)),
                              BigInteger.ZERO,
                              BigInteger.valueOf(4L));
        ECPoint g = new ECPoint(BigInteger.ZERO, BigInteger.valueOf(2L));
        ECParameterSpec params =
            new ECParameterSpec(c, g, BigInteger.valueOf(5L), 10);
        BigInteger s = BigInteger.valueOf(5L);

        ECPrivateKeySpec ks = new ECPrivateKeySpec(s, params);
View Full Code Here

        // Valid (see note below) parameters set
        EllipticCurve c =
            new EllipticCurve(new ECFieldFp(BigInteger.valueOf(5L)),
                              BigInteger.ZERO,
                              BigInteger.valueOf(4L));
        ECPoint g = new ECPoint(BigInteger.ZERO, BigInteger.valueOf(2L));
        new ECPublicKeySpec(g,
                new ECParameterSpec(c, g, BigInteger.valueOf(5L), 10));
       
    }
View Full Code Here

        // Valid (see note below) parameters set
        EllipticCurve c =
            new EllipticCurve(new ECFieldFp(BigInteger.valueOf(5L)),
                              BigInteger.ZERO,
                              BigInteger.valueOf(4L));
        ECPoint g = new ECPoint(BigInteger.ZERO, BigInteger.valueOf(2L));

        // Test case 1: w is null
        try {
            new ECPublicKeySpec(null,
                new ECParameterSpec(c, g, BigInteger.valueOf(5L), 10));
View Full Code Here

         // Valid (see note below) parameters set
         EllipticCurve c =
             new EllipticCurve(new ECFieldFp(BigInteger.valueOf(5L)),
                               BigInteger.ZERO,
                               BigInteger.valueOf(4L));
         ECPoint g = new ECPoint(BigInteger.ZERO, BigInteger.valueOf(2L));

         try {
             new ECPublicKeySpec(ECPoint.POINT_INFINITY,
                     new ECParameterSpec(c, g, BigInteger.valueOf(5L), 10));
            fail("Expected IAE not thrown");
View Full Code Here

        // Valid (see note below) parameters set
        EllipticCurve c =
            new EllipticCurve(new ECFieldFp(BigInteger.valueOf(5L)),
                              BigInteger.ZERO,
                              BigInteger.valueOf(4L));
        ECPoint g = new ECPoint(BigInteger.ZERO, BigInteger.valueOf(2L));
        ECParameterSpec params =
            new ECParameterSpec(c, g, BigInteger.valueOf(5L), 10);

        ECPublicKeySpec ks = new ECPublicKeySpec(g, params);
        ECParameterSpec paramsRet = ks.getParams();
View Full Code Here

        // Valid (see note below) parameters set
        EllipticCurve c =
            new EllipticCurve(new ECFieldFp(BigInteger.valueOf(5L)),
                              BigInteger.ZERO,
                              BigInteger.valueOf(4L));
        ECPoint g = new ECPoint(BigInteger.ZERO, BigInteger.valueOf(2L));
        ECParameterSpec params =
            new ECParameterSpec(c, g, BigInteger.valueOf(5L), 10);

        ECPublicKeySpec ks = new ECPublicKeySpec(g, params);
        ECPoint wRet = ks.getW();

        assertEquals(g, wRet);
        assertSame(g, wRet);
    }
View Full Code Here

     * Assertion: creates <code>ECPoint</code> instance<br>
     * Test preconditions: valid parameters passed<br>
     * Expected: must pass without any exceptions
     */
    public final void testECPoint01() {
        new ECPoint(BigInteger.ZERO, BigInteger.ZERO);
        new ECPoint(BigInteger.valueOf(-23456L), BigInteger.valueOf(-23456L));
        new ECPoint(BigInteger.valueOf(123456L), BigInteger.valueOf(123456L));
        new ECPoint(BigInteger.valueOf(-56L), BigInteger.valueOf(234L));
        new ECPoint(BigInteger.valueOf(3456L), BigInteger.valueOf(-2344L));
    }
View Full Code Here

     * Expected: must throw <code>NullPointerException</code>
     */
    public final void testECPoint02() {
        // test case 1: x is null
        try {
            new ECPoint(null, BigInteger.ZERO);
            fail("#1: Expected NPE not thrown");
        } catch (NullPointerException ok) {
        }


        // test case 2: y is null
        try {
            new ECPoint(BigInteger.ZERO, null);
            fail("#2: Expected NPE not thrown");
        } catch (NullPointerException ok) {
        }


        // test case 3: both : x and y are null
        try {
            new ECPoint(null, null);
            fail("#3: Expected NPE not thrown");
        } catch (NullPointerException ok) {
        }
    }
View Full Code Here

     * which is equal to the one passed to the constructor;
     * (both must refer the same object)
     */
    public final void testGetAffineX01() {
        BigInteger x = BigInteger.valueOf(-23456L);
        ECPoint p = new ECPoint(x, BigInteger.valueOf(23456L));
        BigInteger xRet = p.getAffineX();
        assertEquals(x, xRet);
        assertSame(x, xRet);
    }
View Full Code Here

TOP

Related Classes of java.security.spec.ECPoint

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.