code: public static byte []
  fromDNS(byte [] sig) {
  	final int len = 20;
  	int n = 0;
  	byte rlen, slen, seqlen;
  
  	rlen = len;
  	if (sig[1] < 0)
  		rlen++;
  
  	slen = len;
  	if (sig[len + 1] < 0)
  		slen++;
  
  	/* 4 = 2 * (INT, value) */
  	seqlen = (byte) (rlen + slen + 4);
  
  	/* 2 = 1 * (SEQ, value) */
  	byte [] array = new byte[seqlen + 2];
  
  	array[n++] = ASN1_SEQ;
  	array[n++] = (byte) seqlen;
  	array[n++] = ASN1_INT;
  	array[n++] = rlen;
  	if (rlen > len)
  		array[n++] = 0;
  	for (int i = 0; i < len; i++, n++)
  		array[n] = sig[1 + i];
  	array[n++] = ASN1_INT;
  	array[n++] = slen;
  	if (slen > len)
  		array[n++] = 0;
  	for (int i = 0; i < len; i++, n++)
  		array[n] = sig[1 + len + i];
  	return array;
  }
docs: Converts the signature field in a SIG record to the
  format expected by the DSA verification routines.