static SIGRecord
signMessage(Message message, SIGRecord previous, KEYRecord key,
	    PrivateKey privkey, Date inception, Date expiration)
	throws DNSSECException
{
	int alg = key.getAlgorithm();
	checkAlgorithm(privkey, alg);

	SIGRecord sig = new SIGRecord(Name.root, DClass.ANY, 0, 0,
					    alg, 0, expiration, inception,
					    key.getFootprint(),
					    key.getName(), null);
	DNSOutput out = new DNSOutput();
	digestSIG(out, sig);
	if (previous != null)
		out.writeByteArray(previous.getSignature());
	out.writeByteArray(message.toWire());

	sig.setSignature(sign(privkey, key.getPublicKey(),
			      alg, out.toByteArray(), null));
	return sig;
}
Generate a DNSSEC signature.  key and privateKey must refer to the
same underlying cryptographic key.
@param rrset The data to be signed
@param key The DNSKEY record to use as part of signing
@param privkey The PrivateKey to use when signing
@param inception The time at which the signatures should become valid
@param expiration The time at which the signatures should expire
@param provider The name of the JCA provider.  If non-null, it will be
passed to JCA getInstance() methods.
@throws UnsupportedAlgorithmException The algorithm is unknown
@throws MalformedKeyException The key is malformed
@throws DNSSECException Some other error occurred.
@return The generated signature
src/main/java/core/org/xbill/DNS/DNSSEC.java