httpClose(http);
}
+ /*
+ * Password/PIN printing...
+ */
+
+ if ((attr = ippFindAttribute(response, "job-password-supported", IPP_TAG_INTEGER)) != NULL)
+ {
+ char pattern[33]; /* Password pattern */
+ int maxlen = ippGetInteger(attr, 0);
+ /* Maximum length */
+ const char *repertoire = ippGetString(ippFindAttribute(response, "job-password-repertoire-configured", IPP_TAG_KEYWORD), 0, NULL);
+ /* Type of password */
+
+ if (maxlen > (int)(sizeof(pattern) - 1))
+ maxlen = sizeof(pattern) - 1;
+
+ if (!repertoire || !strcmp(repertoire, "iana_us-ascii_digits"))
+ memset(pattern, '1', maxlen);
+ else if (!strcmp(repertoire, "iana_us-ascii_letters"))
+ memset(pattern, 'A', maxlen);
+ else if (!strcmp(repertoire, "iana_us-ascii_complex"))
+ memset(pattern, 'C', maxlen);
+ else if (!strcmp(repertoire, "iana_us-ascii_any"))
+ memset(pattern, '.', maxlen);
+ else if (!strcmp(repertoire, "iana_utf-8_digits"))
+ memset(pattern, 'N', maxlen);
+ else if (!strcmp(repertoire, "iana_utf-8_letters"))
+ memset(pattern, 'U', maxlen);
+ else
+ memset(pattern, '*', maxlen);
+
+ pattern[maxlen] = '\0';
+
+ cupsFilePrintf(fp, "*cupsPassword: \"%s\"\n", pattern);
+ }
+
/*
* Filters...
*/
<p class='summary'>*cupsJobPassword: "format"</p>
-<p>This keyword defines the format of the job-password IPP attribute, if supported by the printer. Currently the only supported format is "1111" indicating a 4-digit PIN code.</p>
+<p>This keyword defines the format of the "job-password" IPP attribute, if supported by the printer. The following format characters are supported:</p>
+
+<ul>
+ <li><code>1</code>: US ASCII digits.</li>
+ <li><code>A</code>: US ASCII letters.</li>
+ <li><code>C</code>: US ASCII letters, numbers, and punctuation.</li>
+ <li><code>.</code>: Any US ASCII printable character (0x20 to 0x7e).</li>
+ <li><code>N</code>: Any Unicode digit character.</li>
+ <li><code>U</code>: Any Unicode letter character.</li>
+ <li><code>*</code>: Any Unicode (utf-8) character.</li>
+</ul>
+
+<p>The format characters are repeated to indicate the length of the
+password string. For example, "1111" indicated a 4-digit US ASCII PIN code.</p>
<p>Example:</p>