Lines Matching defs:pkey
226 * or it should point to a valid STACK_OF(X509) structure. pkey and cert can
240 * pkey - Points to location pointing to the private key returned.
277 int keyid_len, char *name_str, EVP_PKEY **pkey, X509 **cert,
290 if (pkey)
291 *pkey = NULL;
333 name_str, pkey, cert, ca);
341 if (pkey && *pkey) {
342 sunw_evp_pkey_free(*pkey);
392 STACK_OF(EVP_PKEY) **pkey, STACK_OF(X509) **certs)
418 retval = set_results(pkey, &work_kl, certs, &work_ca, NULL, NULL, NULL,
455 sunw_PKCS12_contents(PKCS12 *p12, const char *pass, STACK_OF(EVP_PKEY) **pkey,
484 retval = set_results(pkey, &work_kl, certs, &work_ca, NULL,
646 EVP_PKEY *pkey = NULL;
793 pkey = sk_EVP_PKEY_value(pkeys, i);
796 if ((p8 = EVP_PKEY2PKCS8(pkey)) == NULL) {
811 len = sunw_get_pkey_fname(GETDO_COPY, pkey,
823 len = sunw_get_pkey_localkeyid(GETDO_COPY, pkey,
921 * pkey - Entry which potentially has attributes to be freed.
927 sunw_evp_pkey_free(EVP_PKEY *pkey)
929 if (pkey != NULL) {
930 if (pkey->attributes != NULL) {
931 sk_X509_ATTRIBUTE_pop_free(pkey->attributes,
933 pkey->attributes = NULL;
935 EVP_PKEY_free(pkey);
946 * pkey - Points to a private key to set the keyidstr in.
959 sunw_set_localkeyid(const char *keyid_str, int keyid_len, EVP_PKEY *pkey,
975 if (pkey != NULL) {
996 if (pkey->attributes == NULL) {
997 pkey->attributes = sk_X509_ATTRIBUTE_new_null();
998 if (pkey->attributes == NULL) {
1004 i = find_attr_by_nid(pkey->attributes, NID_localKeyID);
1006 sk_X509_ATTRIBUTE_delete(pkey->attributes, i);
1008 if (sk_X509_ATTRIBUTE_push(pkey->attributes, attr) == 0) {
1033 * pkey - Points to a private key to set the keyidstr in.
1046 sunw_get_pkey_localkeyid(getdo_actions_t dowhat, EVP_PKEY *pkey,
1060 if (pkey == NULL || pkey->attributes == NULL) {
1064 if ((i = find_attr_by_nid(pkey->attributes, NID_localKeyID)) < 0) {
1067 attr = sk_X509_ATTRIBUTE_value(pkey->attributes, i);
1075 attr = sk_X509_ATTRIBUTE_delete(pkey->attributes, i);
1100 * pkey - Points to a private key to get the frientlyname from
1111 sunw_get_pkey_fname(getdo_actions_t dowhat, EVP_PKEY *pkey, char **fname)
1122 if (pkey == NULL || pkey->attributes == NULL) {
1126 if ((i = find_attr_by_nid(pkey->attributes, NID_friendlyName)) < 0) {
1129 attr = sk_X509_ATTRIBUTE_value(pkey->attributes, i);
1137 attr = sk_X509_ATTRIBUTE_delete(pkey->attributes, i);
1176 * - Pointer to receive address of first matching pkey found.
1252 * - Pointer to receive address of first matching pkey found.
1362 * pkey - Points to a private key to set the fname in.
1375 sunw_set_fname(const char *ascname, EVP_PKEY *pkey, X509 *cert)
1405 if (pkey != NULL) {
1423 if (pkey->attributes == NULL) {
1424 pkey->attributes = sk_X509_ATTRIBUTE_new_null();
1425 if (pkey->attributes == NULL) {
1430 } else if ((i = find_attr_by_nid(pkey->attributes,
1432 (void) sk_X509_ATTRIBUTE_delete(pkey->attributes, i);
1435 if (sk_X509_ATTRIBUTE_push(pkey->attributes, attr) == 0) {
1463 * pkey - Points to a private key.
1470 sunw_check_keys(X509 *cert, EVP_PKEY *pkey)
1474 if (pkey != NULL && cert != NULL)
1475 retval = X509_check_private_key(cert, pkey);
1523 * pkey - Points to location pointing to the private key returned.
1542 int kstr_len, char *name_str, EVP_PKEY **pkey, X509 **cert,
1585 work_kl, work_cl, pkey, cert);
1603 pkey, cert);
1615 retval = get_key_cert(0, work_kl, pkey, work_cl, cert);
1634 retval = get_key_cert(n, work_kl, pkey, work_cl, cert);
1654 retval = get_key_cert(0, tmpk, pkey, tmpc, cert);
1674 if (pkey != NULL && *pkey != NULL) {
1675 sunw_evp_pkey_free(*pkey);
1676 *pkey = NULL;
1807 EVP_PKEY *pkey = NULL;
1818 if ((pkey = EVP_PKCS82PKEY(bag->value.keybag)) == NULL) {
1835 pkey = EVP_PKCS82PKEY(p8);
1837 if (pkey == NULL) {
1931 if (pkey != NULL) {
1933 pkey->attributes == NULL) {
1934 pkey->attributes = sk_X509_ATTRIBUTE_new_null();
1935 if (pkey->attributes == NULL) {
1951 if (sk_X509_ATTRIBUTE_push(pkey->attributes,
1971 if (sk_X509_ATTRIBUTE_push(pkey->attributes,
1984 if (sk_EVP_PKEY_push(kl, pkey) == 0) {
1989 pkey = NULL;
1994 if (pkey != NULL) {
1995 sunw_evp_pkey_free(pkey);
2107 pp = &(x->x_pkey->dec_pkey->pkey.rsa);
2119 pp = &(x->x_pkey->dec_pkey->pkey.dsa);
2234 * pkey - Points at location where the address of the matching private
2254 get_key_cert(int n, STACK_OF(EVP_PKEY) *kl, EVP_PKEY **pkey, STACK_OF(X509) *cl,
2264 if (pkey != NULL && *pkey == NULL) {
2266 *pkey = sk_EVP_PKEY_delete(kl, n);
2267 if (*pkey != NULL)
2558 * pkey - Points at a location where the address of the matching private
2569 * A pkey structure has a stack of attributes.
2585 * A pointer to cert and/or pkey which matches the name or keyid is stored
2594 find_attr(int nid, ASN1_STRING *str, STACK_OF(EVP_PKEY) *kl, EVP_PKEY **pkey,
2610 chkcerts = (cert != NULL || pkey != NULL) && cl != NULL;
2667 if (pkey != NULL && kl != NULL) {
2669 * Looking for pkey to match a cert? If so, assume that
2678 if (pkey != NULL)
2679 *pkey = sk_EVP_PKEY_delete(kl, k);
2694 if (pkey != NULL)
2695 *pkey = sk_EVP_PKEY_delete(kl, k);