20 #include <winpr/assert.h>
22 #include <freerdp/client/utils/smartcard_cli.h>
23 #include <freerdp/utils/smartcardlogon.h>
25 BOOL freerdp_smartcard_list(
const rdpSettings* settings)
30 if (!smartcard_enumerateCerts(settings, &certs, &count, FALSE))
33 printf(
"smartcard reader detected, listing %" PRIuz
" certificates:\n", count);
34 for (
size_t i = 0; i < count; i++)
37 char asciiStr[256] = { 0 };
41 printf(
"%" PRIuz
": %s\n", i, info->subject);
43 if (ConvertWCharToUtf8(info->csp, asciiStr, ARRAYSIZE(asciiStr)))
44 printf(
"\t* CSP: %s\n", asciiStr);
46 if (ConvertWCharToUtf8(info->reader, asciiStr, ARRAYSIZE(asciiStr)))
47 printf(
"\t* reader: %s\n", asciiStr);
49 printf(
"\t* slotId: %" PRIu32
"\n", info->slotId);
50 printf(
"\t* pkinitArgs: %s\n", info->pkinitArgs);
52 if (ConvertWCharToUtf8(info->containerName, asciiStr, ARRAYSIZE(asciiStr)))
53 printf(
"\t* containerName: %s\n", asciiStr);
55 printf(
"\t* UPN: %s\n", info->upn);
57 smartcardCertList_Free(certs, count);