Wrapped Encryption Key Template
The DES encryption key that we wrap with the user RSA key will need to have its attributes specified within a template as follows:
/* Wrapped encryption key template */static char True = TRUE;static CK_OBJECT_CLASS Class = CKO_SECRET_KEY;static CK_KEY_TYPE Kt = CKK_DES2;static CK_ATTRIBUTE wrappedKeyTemp[] = { {CKA_CLASS, &Class, sizeof(Class)},{CKA_KEY_TYPE, &Kt, sizeof(Kt)},{CKA_EXTRACTABLE, &True, 1},{CKA_ENCRYPT, &True, 1},};
Next, see Assembling the Application.