Examples of DSAPublicKeySpec


Examples of java.security.spec.DSAPublicKeySpec

      seed = new DOMCryptoBinary(curElem.getFirstChild());
      curElem = DOMUtils.getNextSiblingElement(curElem);
      pgen = new DOMCryptoBinary(curElem.getFirstChild());
  }
  //@@@ do we care about j, pgenCounter or seed?
  DSAPublicKeySpec spec = new DSAPublicKeySpec
      (y.getBigNum(), p.getBigNum(), q.getBigNum(), g.getBigNum());
        return (DSAPublicKey) generatePublicKey(dsakf, spec);
    }
View Full Code Here

Examples of java.security.spec.DSAPublicKeySpec

                BigInteger p = getMPInt();
                BigInteger q = getMPInt();
                BigInteger g = getMPInt();
                BigInteger y = getMPInt();
                KeyFactory keyFactory = SecurityUtils.getKeyFactory("DSA");
                key = keyFactory.generatePublic(new DSAPublicKeySpec(y, p, q, g));
            } else {
                throw new IllegalStateException("Unsupported algorithm: " + keyAlg);
            }
            return key;
        } catch (InvalidKeySpecException e) {
View Full Code Here

Examples of java.security.spec.DSAPublicKeySpec

                BigInteger q = getMPInt();
                BigInteger g = getMPInt();
                BigInteger y = getMPInt();
                BigInteger x = getMPInt();
                KeyFactory keyFactory = SecurityUtils.getKeyFactory("DSA");
                pub = keyFactory.generatePublic(new DSAPublicKeySpec(y, p, q, g));
                prv = keyFactory.generatePrivate(new DSAPrivateKeySpec(x, p, q, g));
            } else {
                throw new IllegalStateException("Unsupported algorithm: " + keyAlg);
            }
            return new KeyPair(pub, prv);
View Full Code Here

Examples of java.security.spec.DSAPublicKeySpec

     * The test checks out that the method returns DSAPublicKey
     * if argument is "DSAPublicKeySpec"
     */
    public final void testGeneratePublicKeySpec03() throws Exception {

        KeySpec keySpec = (KeySpec) new DSAPublicKeySpec(publicY, publicP, publicQ, publicG);

        checkPublicKeys( (DSAPublicKey) kf.generatePublic(keySpec) );
    }
View Full Code Here

Examples of java.security.spec.DSAPublicKeySpec

    /**
     * Test for <code>DSAPublicKeySpec</code> ctor
     */
    public final void testDSAPublicKeySpec() {
        KeySpec ks = new DSAPublicKeySpec(
                new BigInteger("1"), // y
                new BigInteger("2"), // p
                new BigInteger("3"), // q
                new BigInteger("4"));// g
       
View Full Code Here

Examples of java.security.spec.DSAPublicKeySpec

    /**
     * Test for <code>getG</code> method
     */
    public final void testGetG() {
        DSAPublicKeySpec dpks = new DSAPublicKeySpec(
                new BigInteger("1"), // y
                new BigInteger("2"), // p
                new BigInteger("3"), // q
                new BigInteger("4"));// g
       
        assertEquals(4, dpks.getG().intValue());
    }
View Full Code Here

Examples of java.security.spec.DSAPublicKeySpec

    /**
     * Test for <code>getP</code> method
     */
    public final void testGetP() {
        DSAPublicKeySpec dpks = new DSAPublicKeySpec(
                new BigInteger("1"), // y
                new BigInteger("2"), // p
                new BigInteger("3"), // q
                new BigInteger("4"));// g
       
        assertEquals(2, dpks.getP().intValue());
    }
View Full Code Here

Examples of java.security.spec.DSAPublicKeySpec

    /**
     * Test for <code>getQ</code> method
     */
    public final void testGetQ() {
        DSAPublicKeySpec dpks = new DSAPublicKeySpec(
                new BigInteger("1"), // y
                new BigInteger("2"), // p
                new BigInteger("3"), // q
                new BigInteger("4"));// g
       
        assertEquals(3, dpks.getQ().intValue());
    }
View Full Code Here

Examples of java.security.spec.DSAPublicKeySpec

    /**
     * Test for <code>getY</code> method
     */
    public final void testGetY() {
        DSAPublicKeySpec dpks = new DSAPublicKeySpec(
                new BigInteger("1"), // y
                new BigInteger("2"), // p
                new BigInteger("3"), // q
                new BigInteger("4"));// g
       
        assertEquals(1, dpks.getY().intValue());
    }
View Full Code Here

Examples of java.security.spec.DSAPublicKeySpec

            BigInteger p = getMPInt();
            BigInteger q = getMPInt();
            BigInteger g = getMPInt();
            BigInteger y = getMPInt();
            KeyFactory keyFactory = SecurityUtils.getKeyFactory("DSA");
            key = keyFactory.generatePublic(new DSAPublicKeySpec(y, p, q, g));
        } else {
            throw new IllegalStateException("Unsupported algorithm: " + keyAlg);
        }
        return key;
    }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.