Examples of DSAParameterSpec


Examples of java.security.spec.DSAParameterSpec

    private void readObject(
        ObjectInputStream in)
        throws IOException, ClassNotFoundException
    {
        this.y = (BigInteger)in.readObject();
        this.dsaSpec = new DSAParameterSpec((BigInteger)in.readObject(), (BigInteger)in.readObject(), (BigInteger)in.readObject());
    }
View Full Code Here

Examples of java.security.spec.DSAParameterSpec

            AlgorithmParameters params;

            try
            {
                params = AlgorithmParameters.getInstance("DSA", "BC");
                params.init(new DSAParameterSpec(p.getP(), p.getQ(), p.getG()));
            }
            catch (Exception e)
            {
                throw new RuntimeException(e.getMessage());
            }
View Full Code Here

Examples of java.security.spec.DSAParameterSpec

        if (!areEqual(encodeParams, encodeParams_2))
        {
            fail("encode/decode parameters failed");
        }
       
        DSAParameterSpec dsaP = (DSAParameterSpec)params.getParameterSpec(DSAParameterSpec.class);
       
        KeyPairGenerator    g = KeyPairGenerator.getInstance("DSA", "BC");
        g.initialize(dsaP, new SecureRandom());
        KeyPair p = g.generateKeyPair();
       
View Full Code Here

Examples of java.security.spec.DSAParameterSpec

   */
  public void test_setParameterLjava_security_spec_AlgorithmParameterSpec() throws Exception {
    Signature sig = Signature.getInstance("DSA");

    try {
      DSAParameterSpec spec = new DSAParameterSpec(BigInteger.ONE,
          BigInteger.ONE, BigInteger.ONE);
      sig.setParameter(spec);
    } catch (InvalidParameterException e) {
      // Could be that it's an invalid param for the found algorithm
    } catch (UnsupportedOperationException e) {
View Full Code Here

Examples of java.security.spec.DSAParameterSpec

        // init(AlgorithmParameterSpec)
        BigInteger p = BigInteger.ONE;
        BigInteger q = BigInteger.TEN;
        BigInteger g = BigInteger.ZERO;
        params.init(new DSAParameterSpec(p, q, g));

        // getEncoded() and getEncoded(String) (TODO verify returned encoding)
        byte[] enc = params.getEncoded();
        assertNotNull(enc);
        assertNotNull(params.getEncoded("ASN.1"));
        // TODO assertNotNull(params.getEncoded(null)); // HARMONY-2680

        // getParameterSpec(Class)
        DSAParameterSpec spec = params.getParameterSpec(DSAParameterSpec.class);
        assertEquals("p is wrong ", p, spec.getP());
        assertEquals("q is wrong ", q, spec.getQ());
        assertEquals("g is wrong ", g, spec.getG());

        // init(byte[])
        params = AlgorithmParameters.getInstance("DSA");
        params.init(enc);
        assertTrue("param encoded is different", Arrays.equals(enc, params
View Full Code Here

Examples of java.security.spec.DSAParameterSpec

    JDKDSAPublicKey(
        DSAPublicKeySpec    spec)
    {
        this.y = spec.getY();
        this.dsaSpec = new DSAParameterSpec(spec.getP(), spec.getQ(), spec.getG());
    }
View Full Code Here

Examples of java.security.spec.DSAParameterSpec

    JDKDSAPublicKey(
        DSAPublicKeyParameters  params)
    {
        this.y = params.getY();
        this.dsaSpec = new DSAParameterSpec(params.getParameters().getP(), params.getParameters().getQ(), params.getParameters().getG());
    }
View Full Code Here

Examples of java.security.spec.DSAParameterSpec

        {
            throw new IllegalArgumentException("invalid info structure in DSA public key", e);
        }

        this.y = derY.getValue();
        this.dsaSpec = new DSAParameterSpec(params.getP(), params.getQ(), params.getG());
    }
View Full Code Here

Examples of java.security.spec.DSAParameterSpec

       
        BigInteger gComponent = keyDescriptor.getG().getValueBigInt();
        BigInteger pComponent = keyDescriptor.getP().getValueBigInt();
        BigInteger qComponent = keyDescriptor.getQ().getValueBigInt();

        DSAParams  dsaParams = new DSAParameterSpec(pComponent, qComponent, gComponent);
        return getDSAKey(keyDescriptor, dsaParams);
    }
View Full Code Here

Examples of java.security.spec.DSAParameterSpec

    JDKDSAPublicKey(
        DSAPublicKeySpec    spec)
    {
        this.y = spec.getY();
        this.dsaSpec = new DSAParameterSpec(spec.getP(), spec.getQ(), spec.getG());
    }
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.