code: public static CERTRecord
  buildRecord(Name name, int dclass, long ttl, Certificate cert, int tag,
  	    int alg)
  {
  	int type;
  	byte [] data;
  
  	try {
  		if (cert instanceof X509Certificate) {
  			type = CERTRecord.PKIX;
  			data = cert.getEncoded();
  		}
  		else
  			return null;
  
  		return new CERTRecord(name, dclass, ttl, type, tag, alg, data);
  	}
  	catch (CertificateException e) {
  		if (Options.check("verboseexceptions"))
  			System.err.println("Cert build exception:" + e);
  		return null;
  	}
  }
docs: Builds a CERT record from a Certificate associated with a key also in DNS