Package java.security.spec

Examples of java.security.spec.ECFieldFp


        throws Exception
    {
        KeyPairGenerator g = KeyPairGenerator.getInstance("ECDSA", "BC");

        EllipticCurve curve = new EllipticCurve(
            new ECFieldFp(new BigInteger("883423532389192164791648750360308885314476597252960362792450860609699839")), // q
            new BigInteger("7fffffffffffffffffffffff7fffffffffff8000000000007ffffffffffc", 16), // a
            new BigInteger("6b016c3bdcf18941d0d654921475ca71a9db2fb27d1d37796185c2942c0a", 16)); // b

        java.security.spec.ECParameterSpec ecSpec = new java.security.spec.ECParameterSpec(
            curve,
View Full Code Here


    SecureRandom    random = new FixedSecureRandom(new byte[][] { k1, k2 });
   
    private void decodeTest()
    {
        EllipticCurve curve = new EllipticCurve(
                new ECFieldFp(new BigInteger("6277101735386680763835789423207666416083908700390324961279")), // q
                new BigInteger("fffffffffffffffffffffffffffffffefffffffffffffffc", 16), // a
                new BigInteger("64210519e59c80e70fa7e9ab72243049feb8deecc146b9b1", 16)); // b

        ECPoint p = ECPointUtil.decodePoint(curve, Hex.decode("03188da80eb03090f67cbf20eb43a18800f4ff0afd82ff1012"));
View Full Code Here

        byte[] kData = BigIntegers.asUnsignedByteArray(new BigInteger("700000017569056646655505781757157107570501575775705779575555657156756655"));

        SecureRandom    k = new FixedSecureRandom(kData);

        EllipticCurve curve = new EllipticCurve(
            new ECFieldFp(new BigInteger("883423532389192164791648750360308885314476597252960362792450860609699839")), // q
            new BigInteger("7fffffffffffffffffffffff7fffffffffff8000000000007ffffffffffc", 16), // a
            new BigInteger("6b016c3bdcf18941d0d654921475ca71a9db2fb27d1d37796185c2942c0a", 16)); // b

        ECParameterSpec spec = new ECParameterSpec(
            curve,
View Full Code Here

        byte[]              data = { 1, 2, 3, 4, 5, 6, 7, 8, 9, 0 };
        Signature s = Signature.getInstance("ECDSA", "BC");
        KeyPairGenerator g = KeyPairGenerator.getInstance("ECDSA", "BC");

        EllipticCurve curve = new EllipticCurve(
            new ECFieldFp(new BigInteger("883423532389192164791648750360308885314476597252960362792450860609699839")), // q
            new BigInteger("7fffffffffffffffffffffff7fffffffffff8000000000007ffffffffffc", 16), // a
            new BigInteger("6b016c3bdcf18941d0d654921475ca71a9db2fb27d1d37796185c2942c0a", 16)); // b

        ECParameterSpec ecSpec = new ECParameterSpec(
            curve,
View Full Code Here

        throws Exception
    {
        KeyPairGenerator    g = KeyPairGenerator.getInstance(algorithm, "BC");

        EllipticCurve curve = new EllipticCurve(
                new ECFieldFp(new BigInteger("883423532389192164791648750360308885314476597252960362792450860609699839")), // q
                new BigInteger("7fffffffffffffffffffffff7fffffffffff8000000000007ffffffffffc", 16), // a
                new BigInteger("6b016c3bdcf18941d0d654921475ca71a9db2fb27d1d37796185c2942c0a", 16)); // b

        ECParameterSpec ecSpec = new ECParameterSpec(
                curve,
View Full Code Here

     *
     * Assertion: creates new object of <code>ECFieldFp</code> class
     * using valid <code>p</code> (odd prime)
     */
    public final void testECFieldFp01() {
        new ECFieldFp(BigInteger.valueOf(23L));
    }
View Full Code Here

     *
     * Assertion: creates new object of <code>ECFieldFp</code> class
     * using valid <code>p</code> (odd but not prime)
     */
    public final void testECFieldFp02() {
        new ECFieldFp(BigInteger.valueOf(21L));
    }
View Full Code Here

     *
     * Assertion: IllegalArgumentException if <code>p</code> is not positive
     */
    public final void testECFieldFp03() {
        try {
            new ECFieldFp(BigInteger.valueOf(-1L));
            fail(getName() +
                    " FAILED: expected exception has not been thrown");
        } catch (IllegalArgumentException e) {
        }
    }
View Full Code Here

     *
     * Assertion: IllegalArgumentException if <code>p</code> is not positive
     */
    public final void testECFieldFp04() {
        try {
            new ECFieldFp(BigInteger.valueOf(0L));
            fail(getName() +
                    " FAILED: expected exception has not been thrown");
        } catch (IllegalArgumentException e) {
        }
    }
View Full Code Here

     *
     * Assertion: NullPointerException if <code>p</code> is null
     */
    public final void testECFieldFp05() {
        try {
            new ECFieldFp(null);
            fail(getName() +
                    " FAILED: expected exception has not been thrown");
        } catch (NullPointerException e) {
        }
    }
View Full Code Here

TOP

Related Classes of java.security.spec.ECFieldFp

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.