Cryptographic Token Interface Standard |
PKCS#11 |
DES3 secret key objects (object class CKO_SECRET_KEY, key type CKK_DES3) hold triple-length DES keys. The following table defines the DES3 secret key object attributes, in addition to the common attributes listed in Table 15 , Table 19 , Table 25 , and Table 42 :
Table 50, DES3 Secret Key Object Attributes
Attribute | Data type | Meaning |
CKA_VALUE1,4,6,7 | Byte array | Key value (always 24 bytes long) |
DES3 keys must always have their parity bits properly set as described in FIPS PUB 46-3 (i.e., each of the DES keys comprising a DES3 key must have its parity bits properly set). Attempting to create or unwrap a DES3 key with incorrect parity will return an error.
The following is a sample template for creating a triple-length DES secret key object:
CK_OBJECT_CLASS class = CKO_SECRET_KEY; CK_KEY_TYPE keyType = CKK_DES3; CK_UTF8CHAR label[] = "A DES3 secret key object"; CK_BYTE value[24] = {...}; CK_BBOOL true = TRUE; CK_ATTRIBUTE template[] = { {CKA_CLASS, &class, sizeof(class)}, {CKA_KEY_TYPE, &keyType, sizeof(keyType)}, {CKA_TOKEN, &true, sizeof(true)}, {CKA_LABEL, label, sizeof(label)-1}, {CKA_ENCRYPT, &true, sizeof(true)}, {CKA_VALUE, value, sizeof(value)} };