PKCS11 & cryptlib 3.3.3

Fred <[email protected]> Wed, 13 Feb 2013 10:04:37 +0100
Newsgroups gmane.comp.encryption.cryptlib
Message-ID <CAH6uPSusw+w+J5H=H9P5Vhr1ftf9S8LMm1T=uV2cE3CkEE-B5Q@mail.gmail.com>
Hello,

Q1° : I am trying to user rebuild cryptlib 333 wit PKCS11 support via
opensc under Linux, but it seems like if build script does not detect
my opensc installation.
Some vars like HAS_PKCS11 seems to be set by tools/.ccopts.sh when
pkcs11.h is present in some standard directories :
/usr/include, /usr/include/security, /usr/include/opensc/ or
/usr/local/.include.

Is it enought to have have pkcs11 present on there directories or is
it necessary to set USE_PKCS11 before the the build (by setting
environment var or by setting it in misc/config.h ?

Q2° : It seems there is no cryptlib function to enumerate pkcs11 devices.
Does strings like token label value returned by pkcs11-tool --module
/usr/lib/opensc-pkcs11.so
-L can be passed to cryptDeviceOpen ?

pkcs11-tool --module /usr/lib64/opensc-pkcs11.so -L
Available slots:
Slot 0 (0xffffffffffffffff): Virtual hotplug slot
  (empty)
Slot 1 (0x1): Lenovo Integrated Smart Card Reader 00 00
  token label:   PMU Lab CA (User PIN)
  token manuf:   EnterSafe
  token model:   PKCS#15
  token flags:   rng, login required, PIN initialized, token initialized
  serial num  :  1603075509130212

Q3° cryptDeviceOpen arguments :
If I wan to sign cefrt request with a CA certificate and key stored in
the smartcard,

I suppose cryptUser has to be set to CRYPT_USER_CA
I suppose deviceType can be set to CRYPT_DEVICE_PKCS11
I suppose name can be set to token label string returned by pkcs11-tool.

Do you agree or can you explain ?

Best regards,

Fred MAISON

_______________________________________________
Cryptlib mailing list
[email protected] via Mail: [email protected]
Archive: ftp://ftp.franken.de/pub/crypt/cryptlib/archives/
http://news.gmane.org/gmane.comp.encryption.cryptlib
Posts from non-subscribed addresses are blocked to prevent spam, please
subscribe in order to post messages.