key on a smart card may be referenced as:
@example
-pkcs11:token=Nikos;serial=307521161601031;model=PKCS%2315;manufacturer=EnterSafe;\
-object=test1;objecttype=public;\
+pkcs11:token=Nikos;serial=307521161601031;model=PKCS%2315; \
+manufacturer=EnterSafe;object=test1;objecttype=public;\
id=32:f1:53:f3:e3:79:90:b0:86:24:14:10:77:ca:5d:ec:2d:15:fa:ed
@end example
if (ret < 0 && ret != GNUTLS_E_SHORT_MEMORY_BUFFER)
exit(1);
+ /* no error checking from now on */
obj_list = malloc(sizeof(*obj_list)*obj_list_size);
- if (obj_list == NULL)
- exit(1);
- ret = gnutls_pkcs11_obj_list_import_url( obj_list, &obj_list_size, url, flags);
- if (ret < 0)
- exit(1);
+ gnutls_pkcs11_obj_list_import_url( obj_list, &obj_list_size, url, flags);
/* now all certificates are in obj_list */
for (i=0;i<obj_list_size;i++) {
- ret = gnutls_x509_crt_init(&xcrt);
- if (ret < 0)
- exit(1);
+ gnutls_x509_crt_init(&xcrt);
- ret = gnutls_x509_crt_import_pkcs11(xcrt, obj_list[i]);
- if (ret < 0)
- exit(1);
+ gnutls_x509_crt_import_pkcs11(xcrt, obj_list[i]);
- ret = gnutls_x509_crt_print (xcrt, GNUTLS_CRT_PRINT_FULL, &cinfo);
- if (ret < 0)
- exit(1);
+ gnutls_x509_crt_print (xcrt, GNUTLS_CRT_PRINT_FULL, &cinfo);
fprintf(stdout, "cert[%d]:\n %s\n\n", cinfo.data);