Lines Matching defs:handle

104 kmf_find_prikey_by_cert(KMF_HANDLE_T handle, int numattr,
124 if (handle == NULL)
127 CLEAR_ERROR(handle, ret);
136 * in the returned key handle.
157 plugin = FindPlugin(handle, kstype);
161 return (plugin->funclist->FindPrikeyByCert(handle, numattr, attrlist));
166 check_key_usage(void *handle,
175 if (handle == NULL || cert == NULL)
245 kmf_find_cert(KMF_HANDLE_T handle, int numattr, KMF_ATTRIBUTE *attrlist)
257 if (handle == NULL)
260 CLEAR_ERROR(handle, ret);
272 plugin = FindPlugin(handle, kstype);
276 return (plugin->funclist->FindCert(handle, numattr, attrlist));
354 /* Add or reset the key handle attribute */
508 kmf_sign_cert(KMF_HANDLE_T handle, int numattr, KMF_ATTRIBUTE *attrlist)
530 if (handle == NULL)
533 CLEAR_ERROR(handle, ret);
567 policy = handle->policy;
568 ret = check_key_usage(handle, signer_cert, KMF_KU_SIGN_CERT);
583 ret = kmf_find_prikey_by_cert(handle, new_numattr,
632 ret = sign_cert(handle, tbs_cert, sign_key_ptr, oid, signed_cert);
639 kmf_free_kmf_key(handle, &sign_key);
657 kmf_sign_data(KMF_HANDLE_T handle, int numattr,
681 if (handle == NULL)
684 CLEAR_ERROR(handle, ret);
705 ret = check_key_usage(handle, signer_cert, KMF_KU_SIGN_DATA);
711 policy = handle->policy;
726 ret = kmf_find_prikey_by_cert(handle, new_numattr,
767 plugin = FindPlugin(handle, sign_key_ptr->kstype);
773 ret = plugin->funclist->SignData(handle, sign_key_ptr, oid, tbs_data,
801 kmf_free_kmf_key(handle, sign_key_ptr);
826 kmf_verify_data(KMF_HANDLE_T handle,
854 if (handle == NULL)
857 CLEAR_ERROR(handle, ret);
901 policy = handle->policy;
902 ret = check_key_usage(handle, signer_cert, KMF_KU_SIGN_DATA);
931 ret = PKCS_VerifyData(handle, sigAlg,
939 plugin = FindPlugin(handle, kstype);
942 ret = plugin->funclist->EncodePubkeyData(handle,
950 ret = PKCS_VerifyData(handle, sigAlg, &spki,
976 * handle(input) - opaque handle for KMF session
986 kmf_verify_cert(KMF_HANDLE_T handle, int numattr, KMF_ATTRIBUTE *attrlist)
1001 CLEAR_ERROR(handle, ret);
1015 * Caller must provide at least a key handle or a cert to use
1027 ret = verify_cert_with_cert(handle, CertToBeVerified,
1036 plugin = FindPlugin(handle, KMFKey->kstype);
1039 ret = plugin->funclist->EncodePubkeyData(handle,
1046 ret = verify_cert_with_key(handle, &derkey,
1065 * handle(input) - opaque handle for KMF session
1080 kmf_encrypt(KMF_HANDLE_T handle, int numattr, KMF_ATTRIBUTE *attrlist)
1103 CLEAR_ERROR(handle, ret);
1123 policy = handle->policy;
1124 ret = check_key_usage(handle, cert, KMF_KU_ENCRYPT_DATA);
1159 ret = PKCS_EncryptData(handle, algid, pubkey, plaintext, ciphertext);
1175 kmf_decrypt(KMF_HANDLE_T handle, int numattr, KMF_ATTRIBUTE *attrlist)
1200 if (handle == NULL)
1202 CLEAR_ERROR(handle, ret);
1217 policy = handle->policy;
1218 ret = check_key_usage(handle, cert, KMF_KU_ENCRYPT_DATA);
1244 ret = kmf_find_prikey_by_cert(handle, new_numattr, new_attrlist);
1264 plugin = FindPlugin(handle, prikey.kstype);
1267 ret = plugin->funclist->DecryptData(handle,
1278 kmf_free_kmf_key(handle, &prikey);
1286 kmf_store_cert(KMF_HANDLE_T handle, int numattr, KMF_ATTRIBUTE *attrlist)
1300 if (handle == NULL)
1303 CLEAR_ERROR(handle, ret);
1315 plugin = FindPlugin(handle, kstype);
1319 return (plugin->funclist->StoreCert(handle, numattr, attrlist));
1323 kmf_import_cert(KMF_HANDLE_T handle, int numattr, KMF_ATTRIBUTE *attrlist)
1337 if (handle == NULL)
1340 CLEAR_ERROR(handle, ret);
1352 plugin = FindPlugin(handle, kstype);
1356 return (plugin->funclist->ImportCert(handle, numattr, attrlist));
1360 kmf_delete_cert_from_keystore(KMF_HANDLE_T handle, int numattr,
1372 if (handle == NULL)
1375 CLEAR_ERROR(handle, ret);
1387 plugin = FindPlugin(handle, kstype);
1391 return (plugin->funclist->DeleteCert(handle, numattr, attrlist));
1402 cert_get_crl(KMF_HANDLE_T handle, const KMF_DATA *cert, char *proxy,
1415 if (handle == NULL || cert == NULL || filename == NULL ||
1453 ret = kmf_download_crl(handle, uri, proxyname,
1475 check_crl_validity(KMF_HANDLE_T handle, KMF_KEYSTORE_TYPE kstype,
1481 if (handle == NULL)
1484 policy = handle->policy;
1499 ret = kmf_verify_crl_file(handle, crlfilename,
1508 ret = kmf_check_crl_date(handle, crlfilename);
1517 cert_crl_check(KMF_HANDLE_T handle, KMF_KEYSTORE_TYPE *kstype,
1535 if (handle == NULL || kstype == NULL || user_cert == NULL ||
1542 policy = handle->policy;
1578 if ((ret = check_crl_validity(handle, *kstype,
1600 ret = cert_get_crl(handle, user_cert, proxy, crlfile_tmp,
1609 if ((ret = check_crl_validity(handle, *kstype, crlfile_tmp,
1634 ret = kmf_import_crl(handle, numattr, attrlist);
1665 if ((ret = check_crl_validity(handle, *kstype,
1721 ret = kmf_find_cert_in_crl(handle, numattr, attrlist);
1739 cert_ocsp_check(KMF_HANDLE_T handle, KMF_KEYSTORE_TYPE *kstype,
1756 if (handle == NULL || kstype == NULL || user_cert == NULL ||
1760 policy = handle->policy;
1850 ret = kmf_find_cert(handle, fc_numattr, fc_attrlist);
1865 ret = kmf_find_cert(handle, fc_numattr, fc_attrlist);
1889 ret = kmf_get_ocsp_for_cert(handle, user_cert, issuer_cert,
1938 ret = kmf_get_ocsp_status_for_cert(handle, numattr, attrlist);
1970 cert_ku_check(KMF_HANDLE_T handle, KMF_DATA *cert)
1978 if (handle == NULL || cert == NULL)
1981 policy = handle->policy;
2030 cert_eku_check(KMF_HANDLE_T handle, KMF_DATA *cert)
2038 if (handle == NULL || cert == NULL)
2040 policy = handle->policy;
2126 find_issuer_cert(KMF_HANDLE_T handle, KMF_KEYSTORE_TYPE *kstype,
2141 if (handle == NULL || kstype == NULL || user_issuer == NULL ||
2179 ret = kmf_find_cert(handle, fc_numattr, fc_attrlist);
2195 ret = kmf_find_cert(handle, fc_numattr, fc_attrlist);
2246 kmf_free_kmf_cert(handle, &certlist[i]);
2255 find_ta_cert(KMF_HANDLE_T handle, KMF_KEYSTORE_TYPE *kstype,
2273 if (handle == NULL || kstype == NULL || ta_cert == NULL ||
2281 policy = handle->policy;
2327 ret = kmf_find_cert(handle, fc_numattr, fc_attrlist);
2340 ret = kmf_find_cert(handle, fc_numattr, fc_attrlist);
2360 ret = kmf_get_cert_subject_str(handle, ta_cert, &ta_subject);
2375 ret = check_key_usage(handle, ta_cert, KMF_KU_SIGN_CERT);
2381 kmf_free_kmf_cert(handle, &ta_retrCert);
2396 kmf_validate_cert(KMF_HANDLE_T handle, int numattr, KMF_ATTRIBUTE *attrlist)
2420 if (handle == NULL)
2423 CLEAR_ERROR(handle, ret);
2430 policy = handle->policy;
2450 if ((ret = kmf_get_cert_issuer_str(handle, pcert,
2461 if ((ret = kmf_get_cert_subject_str(handle, pcert,
2482 ret = cert_ku_check(handle, pcert);
2490 ret = cert_eku_check(handle, pcert);
2505 ret = kmf_check_cert_date(handle, pcert);
2533 ret = verify_cert_with_cert(handle, pcert, pcert);
2539 ret = find_issuer_cert(handle, kstype, user_issuer,
2551 ret = find_ta_cert(handle, kstype, &ta_cert,
2560 ret = verify_cert_with_cert(handle, pcert,
2600 ret = find_issuer_cert(handle, kstype, user_issuer,
2609 ret = cert_crl_check(handle, kstype, pcert, &issuer_cert);
2617 ret = cert_ocsp_check(handle, kstype, pcert, &issuer_cert,
2755 kmf_is_cert_file(KMF_HANDLE_T handle, char *filename,
2761 CLEAR_ERROR(handle, ret);
2768 ret = kmf_read_input_file(handle, filename, &filedata);
2784 kmf_check_cert_date(KMF_HANDLE_T handle, const KMF_DATA *cert)
2794 CLEAR_ERROR(handle, rv);
2801 policy = handle->policy;
2837 kmf_export_pk12(KMF_HANDLE_T handle, int numattr, KMF_ATTRIBUTE *attrlist)
2851 if (handle == NULL)
2854 CLEAR_ERROR(handle, ret);
2866 plugin = FindPlugin(handle, kstype);
2870 return (plugin->funclist->ExportPK12(handle, numattr, attrlist));
2875 kmf_build_pk12(KMF_HANDLE_T handle, int numcerts,
2884 CLEAR_ERROR(handle, rv);
2892 plugin = FindPlugin(handle, KMF_KEYSTORE_OPENSSL);
2903 rv = buildpk12(handle, numcerts, certlist, numkeys, keylist, p12cred,
2911 kmf_import_objects(KMF_HANDLE_T handle, char *filename,
2921 CLEAR_ERROR(handle, rv);
2932 plugin = FindPlugin(handle, KMF_KEYSTORE_OPENSSL);
2944 rv = import_objects(handle, filename, cred, certs, ncerts,
3006 sign_cert(KMF_HANDLE_T handle,
3102 ret = kmf_sign_data(handle, i, attrlist);
3165 verify_cert_with_key(KMF_HANDLE_T handle,
3178 if (handle == NULL || CertToBeVerified == NULL ||
3221 ret = PKCS_VerifyData(handle, algid, &spki,
3256 verify_cert_with_cert(KMF_HANDLE_T handle,
3269 if (handle == NULL ||
3280 policy = handle->policy;
3283 ret = check_key_usage(handle, SignerCertData, KMF_KU_SIGN_CERT);
3328 ret = PKCS_VerifyData(handle, algid,