Lines Matching refs:bag

16                           PKCS12_SAFEBAG *bag);
18 PKCS12_SAFEBAG *bag);
26 static int copy_bag_attr(PKCS12_SAFEBAG *bag, EVP_PKEY *pkey, int nid) in copy_bag_attr() argument
32 return X509at_add1_attr(&bag->attrib, EVP_PKEY_get_attr(pkey, idx)) != NULL; in copy_bag_attr()
44 PKCS12_SAFEBAG *bag = NULL; in PKCS12_create_ex2() local
84 bag = pkcs12_add_cert_bag(&bags, cert, name, namelen, pkeyid, pkeyidlen); in PKCS12_create_ex2()
86 cbret = cb(bag, cbarg); in PKCS12_create_ex2()
91 pkcs12_remove_bag(&bags, bag); in PKCS12_create_ex2()
98 if ((bag = PKCS12_add_cert(&bags, sk_X509_value(ca, i))) == NULL) in PKCS12_create_ex2()
101 cbret = cb(bag, cbarg); in PKCS12_create_ex2()
106 pkcs12_remove_bag(&bags, bag); in PKCS12_create_ex2()
119 bag = PKCS12_add_key_ex(&bags, pkey, keytype, iter, nid_key, pass, in PKCS12_create_ex2()
122 if (!bag) in PKCS12_create_ex2()
125 if (!copy_bag_attr(bag, pkey, NID_ms_csp_name)) in PKCS12_create_ex2()
127 if (!copy_bag_attr(bag, pkey, NID_LocalKeySet)) in PKCS12_create_ex2()
130 if (name && !PKCS12_add_friendlyname(bag, name, -1)) in PKCS12_create_ex2()
132 if (keyidlen && !PKCS12_add_localkeyid(bag, keyid, keyidlen)) in PKCS12_create_ex2()
135 cbret = cb(bag, cbarg); in PKCS12_create_ex2()
140 pkcs12_remove_bag(&bags, bag); in PKCS12_create_ex2()
199 PKCS12_SAFEBAG *bag = NULL; in pkcs12_add_cert_bag() local
202 if ((bag = PKCS12_SAFEBAG_create_cert(cert)) == NULL) in pkcs12_add_cert_bag()
205 if (name != NULL && !PKCS12_add_friendlyname(bag, name, namelen)) in pkcs12_add_cert_bag()
208 if (keyid != NULL && !PKCS12_add_localkeyid(bag, keyid, keyidlen)) in pkcs12_add_cert_bag()
211 if (!pkcs12_add_bag(pbags, bag)) in pkcs12_add_cert_bag()
214 return bag; in pkcs12_add_cert_bag()
217 PKCS12_SAFEBAG_free(bag); in pkcs12_add_cert_bag()
243 PKCS12_SAFEBAG *bag = NULL; in PKCS12_add_key_ex() local
253 bag = PKCS12_SAFEBAG_create_pkcs8_encrypt_ex(nid_key, pass, -1, NULL, 0, in PKCS12_add_key_ex()
256 bag = PKCS12_SAFEBAG_create0_p8inf(p8); in PKCS12_add_key_ex()
257 if (bag != NULL) in PKCS12_add_key_ex()
264 if (bag == NULL || !pkcs12_add_bag(pbags, bag)) in PKCS12_add_key_ex()
267 return bag; in PKCS12_add_key_ex()
270 PKCS12_SAFEBAG_free(bag); in PKCS12_add_key_ex()
286 PKCS12_SAFEBAG *bag = NULL; in PKCS12_add_secret() local
289 if ((bag = PKCS12_SAFEBAG_create_secret(nid_type, V_ASN1_OCTET_STRING, value, len)) == NULL) in PKCS12_add_secret()
292 if (!pkcs12_add_bag(pbags, bag)) in PKCS12_add_secret()
295 return bag; in PKCS12_add_secret()
297 PKCS12_SAFEBAG_free(bag); in PKCS12_add_secret()
351 PKCS12_SAFEBAG *bag) in pkcs12_remove_bag() argument
355 if (pbags == NULL || bag == NULL) in pkcs12_remove_bag()
358 if ((tmp = sk_PKCS12_SAFEBAG_delete_ptr(*pbags, bag)) == NULL) in pkcs12_remove_bag()
366 PKCS12_SAFEBAG *bag) in pkcs12_add_bag() argument
379 if (!sk_PKCS12_SAFEBAG_push(*pbags, bag)) { in pkcs12_add_bag()