Lines Matching refs:template

290 	CK_ATTRIBUTE template[NUM_SECRETKEY_ATTRS];  in SUNW_C_KeyToObject()  local
317 template[i].type = CKA_CLASS; in SUNW_C_KeyToObject()
318 template[i].pValue = &objclass; in SUNW_C_KeyToObject()
319 template[i].ulValueLen = sizeof (objclass); in SUNW_C_KeyToObject()
328 template[i].type = CKA_KEY_TYPE; in SUNW_C_KeyToObject()
329 template[i].pValue = &keytype; in SUNW_C_KeyToObject()
330 template[i].ulValueLen = sizeof (keytype); in SUNW_C_KeyToObject()
342 template[i].type = mapping[j].attr; in SUNW_C_KeyToObject()
343 template[i].ulValueLen = sizeof (falsevalue); in SUNW_C_KeyToObject()
345 template[i].pValue = &truevalue; in SUNW_C_KeyToObject()
347 template[i].pValue = &falsevalue; in SUNW_C_KeyToObject()
353 template[i].type = CKA_TOKEN; in SUNW_C_KeyToObject()
354 template[i].pValue = &falsevalue; in SUNW_C_KeyToObject()
355 template[i].ulValueLen = sizeof (falsevalue); in SUNW_C_KeyToObject()
359 template[i].type = CKA_VALUE; in SUNW_C_KeyToObject()
360 template[i].pValue = (CK_VOID_PTR)rawkey; in SUNW_C_KeyToObject()
361 template[i].ulValueLen = (CK_ULONG)rawkey_len; in SUNW_C_KeyToObject()
364 rv = C_CreateObject(hSession, template, i, obj); in SUNW_C_KeyToObject()
387 CK_ATTRIBUTE template[NUM_SECRETKEY_ATTRS]; in pkcs11_PasswdToPBKD2Object() local
453 template[i].type = CKA_CLASS; in pkcs11_PasswdToPBKD2Object()
454 template[i].pValue = &objclass; in pkcs11_PasswdToPBKD2Object()
455 template[i].ulValueLen = sizeof (objclass); in pkcs11_PasswdToPBKD2Object()
459 template[i].type = CKA_KEY_TYPE; in pkcs11_PasswdToPBKD2Object()
460 template[i].pValue = &key_type; in pkcs11_PasswdToPBKD2Object()
461 template[i].ulValueLen = sizeof (key_type); in pkcs11_PasswdToPBKD2Object()
465 template[i].type = CKA_TOKEN; in pkcs11_PasswdToPBKD2Object()
466 template[i].pValue = &falsevalue; in pkcs11_PasswdToPBKD2Object()
467 template[i].ulValueLen = sizeof (falsevalue); in pkcs11_PasswdToPBKD2Object()
472 template[i].type = CKA_VALUE_LEN; in pkcs11_PasswdToPBKD2Object()
473 template[i].pValue = &key_len; in pkcs11_PasswdToPBKD2Object()
474 template[i].ulValueLen = sizeof (key_len); in pkcs11_PasswdToPBKD2Object()
485 template[i].type = mapping[j].attr; in pkcs11_PasswdToPBKD2Object()
486 template[i].pValue = (key_flags & ((mapping[j]).flag)) ? in pkcs11_PasswdToPBKD2Object()
488 template[i].ulValueLen = sizeof (falsevalue); in pkcs11_PasswdToPBKD2Object()
492 rv = C_GenerateKey(hSession, &mechanism, template, i, obj); in pkcs11_PasswdToPBKD2Object()
511 CK_ATTRIBUTE template; in pkcs11_ObjectToKey() local
520 template.type = CKA_VALUE; in pkcs11_ObjectToKey()
521 template.pValue = NULL; in pkcs11_ObjectToKey()
522 template.ulValueLen = 0; in pkcs11_ObjectToKey()
525 rv = C_GetAttributeValue(hSession, obj, &template, 1); in pkcs11_ObjectToKey()
530 template.pValue = malloc(template.ulValueLen); in pkcs11_ObjectToKey()
531 if (template.pValue == NULL) { in pkcs11_ObjectToKey()
536 rv = C_GetAttributeValue(hSession, obj, &template, 1); in pkcs11_ObjectToKey()
538 free(template.pValue); in pkcs11_ObjectToKey()
550 *rawkey = template.pValue; in pkcs11_ObjectToKey()
551 *rawkey_len = template.ulValueLen; in pkcs11_ObjectToKey()