CK_CHAR vs CK_BYTE in PKCS#11?

323 Views Asked by At

Does PKCS#11 intend CK_CHAR and CK_BYTE to have identical semantics, or is CK_CHAR intended to imply printability?

The standard PKCS#11 type header defines CK_CHAR in terms of CK_BYTE and says "character" instead of "value":

/* an unsigned 8-bit value */
typedef unsigned char     CK_BYTE;

/* an unsigned 8-bit character */
typedef CK_BYTE           CK_CHAR;

Does this guarantee that every CK_CHAR (and array of CK_CHARs) is within the printable range?

1

There are 1 best solutions below

2
On BEST ANSWER

Answering my own question: section 1.3, table 3 of PKCS#11v2.40 establishes that CK_CHAR is always printable (in ANSI C encoding, which is ASCII).