private static byte []
fromDSAPublicKey(DSAPublicKey key) {
	DNSOutput out = new DNSOutput();
	BigInteger q = key.getParams().getQ();
	BigInteger p = key.getParams().getP();
	BigInteger g = key.getParams().getG();
	BigInteger y = key.getY();
	int t = (p.toByteArray().length - 64) / 8;

	out.writeU8(t);
	writeBigInteger(out, q);
	writeBigInteger(out, p);
	writePaddedBigInteger(out, g, 8 * t + 64);
	writePaddedBigInteger(out, y, 8 * t + 64);

	return out.toByteArray();
}
Converts a KEY/DNSKEY record into a PublicKey
src/main/java/core/org/xbill/DNS/DNSSEC.java