30 fprintf(stderr,
"usage: p11 /path/to/yubihsm_pkcs11/module\n");
34 CK_C_GetFunctionList fn;
35 void *handle = dlopen(
argv[1], RTLD_NOW | RTLD_GLOBAL);
36 assert(handle != NULL);
38 *(
void **) (&fn) = dlsym(handle,
"C_GetFunctionList");
53 const char *password =
"0001password";
60 CK_BYTE exponent[] = {0x00, 0x1, 0x0, 0x1};
68 {
CKA_SIGN, &ck_false,
sizeof(ck_false)},
70 {
CKA_WRAP, &ck_true,
sizeof(ck_true)},
83 sizeof(publicKeyTemplate) /
sizeof(publicKeyTemplate[0]);
88 {
CKA_SIGN, &ck_true,
sizeof(ck_true)},
90 {
CKA_WRAP, &ck_false,
sizeof(ck_false)},
101 sizeof(privateKeyTemplate) /
sizeof(privateKeyTemplate[0]);
103 CK_OBJECT_HANDLE publicKey, privateKey;
106 publicKeyAttributeCount, privateKeyTemplate,
107 privateKeyAttributeCount, &publicKey, &privateKey);