code: protected DERObject convertHexEncoded(
          String  str,
          int     off)
          throws IOException
      {
          str = str.toLowerCase();
          byte[]    data = new byte[str.length() / 2];
          for (int index = 0; index != data.length; index++)
          {
              char left = str.charAt((index * 2) + off);
              char right = str.charAt((index * 2) + off + 1);
  
              if (left < 'a')
              {
                  data[index] = (byte)((left - '0') << 4);
              }
              else
              {
                  data[index] = (byte)((left - 'a' + 10) << 4);
              }
              if (right < 'a')
              {
                  data[index] |= (byte)(right - '0');
              }
              else
              {
                  data[index] |= (byte)(right - 'a' + 10);
              }
          }
  
          ASN1InputStream aIn = new ASN1InputStream(
                                              new ByteArrayInputStream(data));
  
          return aIn.readObject();
      }
docs: Convert an inline encoded hex string rendition of an ASN.1
  object back into its corresponding ASN.1 object.
  
  @param str the hex encoded object
  @param off the index at which the encoding starts
  @return the decoded object