Lines Matching refs:key

255  * Return the value of a secret key object.
283 * Convert a RSA private key object into a crypto_key structure.
289 get_rsa_private_key(kernel_object_t *object_p, crypto_key_t *key)
310 key->ck_format = CRYPTO_KEY_ATTR_LIST;
311 key->ck_attrs = attrs;
315 * Allocate memory for each key attribute and set up the value
318 key->ck_count = 0;
331 key->ck_count++;
346 key->ck_count++;
357 key->ck_count++;
368 key->ck_count++;
380 key->ck_count++;
392 key->ck_count++;
404 key->ck_count++;
412 free_key_attributes(key);
417 * Convert a RSA public key object into a crypto_key structure.
423 get_rsa_public_key(kernel_object_t *object_p, crypto_key_t *key)
443 key->ck_format = CRYPTO_KEY_ATTR_LIST;
444 key->ck_count = RSA_PUB_ATTR_COUNT;
445 key->ck_attrs = attrs;
468 free_key_attributes(key);
476 free_key_attributes(crypto_key_t *key)
480 if (key->ck_format == CRYPTO_KEY_ATTR_LIST &&
481 (key->ck_count > 0) && key->ck_attrs != NULL) {
482 for (i = 0; i < key->ck_count; i++) {
483 if (key->ck_attrs[i].oa_value != NULL) {
484 bzero(key->ck_attrs[i].oa_value,
485 key->ck_attrs[i].oa_value_len);
486 free(key->ck_attrs[i].oa_value);
489 free(key->ck_attrs);
495 * Convert a DSA private key object into a crypto_key structure.
501 get_dsa_private_key(kernel_object_t *object_p, crypto_key_t *key)
521 key->ck_format = CRYPTO_KEY_ATTR_LIST;
522 key->ck_count = DSA_ATTR_COUNT;
523 key->ck_attrs = attrs;
551 free_key_attributes(key);
557 * Convert a DSA public key object into a crypto_key structure.
563 get_dsa_public_key(kernel_object_t *object_p, crypto_key_t *key)
583 key->ck_format = CRYPTO_KEY_ATTR_LIST;
584 key->ck_count = DSA_ATTR_COUNT;
585 key->ck_attrs = attrs;
613 free_key_attributes(key);
619 * Convert a EC private key object into a crypto_key structure.
625 get_ec_private_key(kernel_object_t *object_p, crypto_key_t *key)
646 key->ck_format = CRYPTO_KEY_ATTR_LIST;
647 key->ck_count = EC_ATTR_COUNT;
648 key->ck_attrs = attrs;
686 free_key_attributes(key);
691 * Convert an EC public key object into a crypto_key structure.
697 get_ec_public_key(kernel_object_t *object_p, crypto_key_t *key)
718 key->ck_format = CRYPTO_KEY_ATTR_LIST;
719 key->ck_count = EC_ATTR_COUNT;
720 key->ck_attrs = attrs;
758 free_key_attributes(key);
771 * any key management function, is_token_obj should NOT be NULL.