code: function pemtohex(s, sHead) {
      if (s.indexOf("-----BEGIN ") == -1)
          throw "can't find PEM header: " + sHead;
  
      if (sHead !== undefined) {
          s = s.replace("-----BEGIN " + sHead + "-----", "");
          s = s.replace("-----END " + sHead + "-----", "");
      } else {
          s = s.replace(/-----BEGIN [^-]+-----/, '');
          s = s.replace(/-----END [^-]+-----/, '');
      }
      return b64nltohex(s);
  }
docs: get hexacedimal string from PEM format data<br/>
  @name pemtohex
  @function
  @param {String} s PEM formatted string
  @param {String} sHead PEM header string without BEGIN/END(OPTION)
  @return {String} hexadecimal string data of PEM contents
  @since jsrsasign 7.2.1 base64x 1.1.12
  @description
  This static method gets a hexacedimal string of contents
  from PEM format data. You can explicitly specify PEM header
  by sHead argument.
  Any space characters such as white space or new line
  will be omitted.<br/>
  NOTE: Now {@link KEYUTIL.getHexFromPEM} and {@link X509.pemToHex}
  have been deprecated since jsrsasign 7.2.1.
  Please use this method instead.
  @example
  pemtohex("-----BEGIN PUBLIC KEY...") &rarr; "3082..."
  pemtohex("-----BEGIN CERTIFICATE...", "CERTIFICATE") &rarr; "3082..."
  pemtohex(" \r\n-----BEGIN DSA PRIVATE KEY...") &rarr; "3082..."