public Object decodeSignature(byte[] k) {
      // magic
      if (k[0] != Registry.MAGIC_RAW_DSS_SIGNATURE[0]
            || k[1] != Registry.MAGIC_RAW_DSS_SIGNATURE[1]
            || k[2] != Registry.MAGIC_RAW_DSS_SIGNATURE[2]
            || k[3] != Registry.MAGIC_RAW_DSS_SIGNATURE[3]) {
         throw new IllegalArgumentException("magic");
      }

      // version
      if (k[4] != 0x01) {
         throw new IllegalArgumentException("version");
      }

      int i = 5;
      int l;
      byte[] buffer;

      // r
      l = k[i++] << 24 | (k[i++] & 0xFF) << 16 | (k[i++] & 0xFF) << 8 | (k[i++] & 0xFF);
      buffer = new byte[l];
      System.arraycopy(k, i, buffer, 0, l);
      i += l;
      BigInteger r = new BigInteger(1, buffer);

      // s
      l = k[i++] << 24 | (k[i++] & 0xFF) << 16 | (k[i++] & 0xFF) << 8 | (k[i++] & 0xFF);
      buffer = new byte[l];
      System.arraycopy(k, i, buffer, 0, l);
      i += l;
      BigInteger s = new BigInteger(1, buffer);

      return new BigInteger[] {r, s};
   }