Package java.security.spec

Examples of java.security.spec.ECParameterSpec


        ECPoint g = new ECPoint(BigInteger.ZERO, BigInteger.valueOf(2L));

        // Test case 1: s is null
        try {
            new ECPrivateKeySpec(null,
                new ECParameterSpec(c, g, BigInteger.valueOf(5L), 10));
            fail("#1: Expected NPE not thrown");
        } catch (NullPointerException ok) {
        }

View Full Code Here


        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();
       
        assertEquals(params, paramsRet);
        assertSame(params, paramsRet);
    }
View Full Code Here

        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);
        BigInteger sRet = ks.getS();
View Full Code Here

            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

        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));
            fail("#1: Expected NPE not thrown");
        } catch (NullPointerException ok) {
        }

View Full Code Here

                               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");
         } catch (IllegalArgumentException ok) {
         }
     }
View Full Code Here

        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();
       
        assertEquals(params, paramsRet);
        assertSame(params, paramsRet);
    }
View Full Code Here

        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);
View Full Code Here

        this.ecSpec = null;
    }

    private ECParameterSpec createSpec(EllipticCurve ellipticCurve, ECDomainParameters dp)
    {
        return new ECParameterSpec(
                ellipticCurve,
                new ECPoint(
                        dp.getG().getX().toBigInteger(),
                        dp.getG().getY().toBigInteger()),
                        dp.getN(),
View Full Code Here

                X9ECParameters          ecP = new X9ECParameters((ASN1Sequence)params.getParameters());
               
                curve = ecP.getCurve();
                ellipticCurve = EC5Util.convertCurve(curve, ecP.getSeed());

                this.ecSpec = new ECParameterSpec(
                        ellipticCurve,
                        new ECPoint(
                                ecP.getG().getX().toBigInteger(),
                                ecP.getG().getY().toBigInteger()),
                        ecP.getN(),
View Full Code Here

TOP

Related Classes of java.security.spec.ECParameterSpec

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.