code: static byte []
  fromPublicKey(PublicKey key, int alg) throws DNSSECException
  {
  	byte [] data = null;
  
  	switch (alg) {
  	case Algorithm.RSAMD5:
  	case Algorithm.RSASHA1:
  	case Algorithm.RSA_NSEC3_SHA1:
  	case Algorithm.RSASHA256:
  	case Algorithm.RSASHA512:
  		if (! (key instanceof RSAPublicKey))
  			throw new IncompatibleKeyException();
  		return fromRSAPublicKey((RSAPublicKey) key);
  	case Algorithm.DSA:
  	case Algorithm.DSA_NSEC3_SHA1:
  		if (! (key instanceof DSAPublicKey))
  			throw new IncompatibleKeyException();
  		return fromDSAPublicKey((DSAPublicKey) key);
  	default:
  		throw new UnsupportedAlgorithmException(alg);
  	}
  }
docs: Builds a DNSKEY record from a PublicKey