Code example for DSAPublicKeySpec

0
 
            BigInteger p = bar.readBigInteger();
            BigInteger q = bar.readBigInteger();
            BigInteger g = bar.readBigInteger();
            BigInteger y = bar.readBigInteger();
            dsaKey = new DSAPublicKeySpec(y, p, q, g);
 
            KeyFactory kf = KeyFactory.getInstance("DSA");
             
            pubkey = (DSAPublicKey) kf.generatePublic(dsaKey);
        } catch (Exception e) {
            throw new InvalidKeyException();
        } 
    } 
     
    public PublicKey getPublicKey() {
    	return pubkey;
    }     
 
    /** 
     *