Cryptographic Token Interface Standard

PKCS#11


Server Key and MAC derivation

Server key, MAC and IV derivation in WTLS, denoted CKM_WTLS_SERVER_KEY_AND_MAC_DERIVE, is a mechanism used to derive the appropriate cryptographic keying material used by a cipher suite from the master secret key and random data. This mechanism returns the key handles for the keys generated in the process, as well as the IV created.

It has a parameter, a CK_WTLS_KEY_MAT_PARAMS structure, which allows for the passing of the mechanism type of the digest mechanism to be used, random data, the characteristic of the cryptographic material for the given cipher suite, and a pointer to a structure which receives the handles and IV which were generated.

This mechanism contributes to the creation of two distinct keys and returns one IV (if an IV is requested by the caller) back to the caller. The keys are all given an object class of CKO_SECRET_KEY.

The MACing key (server write MAC secret) is always given a type of CKK_GENERIC_SECRET. It is flagged as valid for signing, verification and derivation operations.

The other key (server write key) is typed according to information found in the template sent along with this mechanism during a C_DeriveKey function call. By default, it is flagged as valid for encryption, decryption, and derivation operations.

An IV (server write IV) will be generated and returned if the ulIVSizeInBits field of the CK_WTLS_KEY_MAT_PARAMS field has a nonzero value. If it is generated, its length in bits will agree with the value in the ulIVSizeInBits field

Both keys inherit the values of the CKA_SENSITIVE, CKA_ALWAYS_SENSITIVE, CKA_EXTRACTABLE, and CKA_NEVER_EXTRACTABLE attributes from the base key. The template provided to C_DeriveKey may not specify values for any of these attributes that differ from those held by the base key.

Note that the CK_WTLS_KEY_MAT_OUT structure pointed to by the CK_WTLS_KEY_MAT_PARAMS structure's pReturnedKeyMaterial field will be modified by the C_DeriveKey call. In particular, the two key handle fields in the CK_WTLS_KEY_MAT_OUT structure will be modified to hold handles to the newly-created keys; in addition, the buffer pointed to by the CK_WTLS_KEY_MAT_OUT structure's pIV field will have the IV returned in them (if an IV is requested by the caller). Therefore, this field must point to a buffer with sufficient space to hold any IV that will be returned.

This mechanism departs from the other key derivation mechanisms in Cryptoki in its returned information. For most key-derivation mechanisms, C_DeriveKey returns a single key handle as a result of a successful completion. However, since the CKM_WTLS_SERVER_KEY_AND_MAC_DERIVE mechanism returns all of its key handles in the CK_WTLS_KEY_MAT_OUT structure pointed to by the CK_WTLS_KEY_MAT_PARAMS structure specified as the mechanism parameter, the parameter phKey passed to C_DeriveKey is unnecessary, and should be a NULL_PTR.

If a call to C_DeriveKey with this mechanism fails, then none of the two keys will be created.


RSA Security Inc. Public-Key Cryptography Standards - PKCS#11 - v220