SMART CARD Related Problem

Hello,

I am trying to store private keys of my S/MIME certificates on a CryptoPlus smart card. I am able to assign the card to my ID and to move the first private key onto the card.

Everything works fine until I try to move a second one private key onto the smart card. In this very moment Lotus Notes client decides to give it the same PKCS#11 label as the first key have, and the process fails, because the PKCS#11 driver does not allow this. Surprise, surprise! :slight_smile:

Does anybody have an idea how to teach Lotus Notes client to name different private keys with different PKCS#11 labels?

Jan

Subject: That’s a PKCS#11 driver bug…

The PKCS#11 specification is very clear on allowing different objects to have identical values for the same attribute, and in fact many of the attributes of a PKCS#11 object are populated by (identical) default values by the PKCS#11 library. Section 9.0 of PKCS#11 v2.01 and Section 10.0 of PKCS#11 v2.11 and PKCS#11 v2.20 even states that “it is permissable for two or more objects to have exactly the same values for all their attributes”.

If you are using an outdated version of the smartcard drivers, I would recommend upgrading your drivers to the latest version. You’re encountering a fairly severe PKCS#11 driver bug, and hopefully the token manufacturer has fixed this one by now.

What is the manufacturer and exact version of the smartcard drivers that you are using? We’ve tested the scenario that you encountered on a wide variety of different tokens, and haven’t run into that particular driver bug yet.

Subject: RE: That’s a PKCS#11 driver bug…

Hi Dave,

thank you for your prompt response. I have consulted this issue with manufacturer of the smart card solution (CryptoPlus, www.cryptoplus.cz) yesterday. They said this was not a bug but a feature.

They share the PKCS#11 label with the Windows CSP API driver and therefore they need this to be unique. This is the unique identifier of the key for them, regardless of API driver used to access the key.

The only accredited CA in our country cooperates exclusively with this manufacturer, so users are bound to this solution. They are buying the card and accompanied software as a bundle with their certificate.

BTW, Dave, I guess you are involved in development of this part of Lotus Notes, so I would like to tell you also, that we are experiencing serious problem with the unability of this client to accept hardware generated private key. Our law specifies that user have to have EXCLUSIVE access to the private key used to digitaly sign documents, because documents signed with certificate issued by our accredited CA are equal to hand signed documents according to the law of our country.

Currently we have to generate ID without recovery info, transfer it to a standalone PC, software generate a new key pair, get certificate from our CA, export the certificate from Windows store, import it to the Lotus Notes, move private key into smart card and then wipe entire hard drive of the standalone PC! Incredible work instead of a simple registration of existing hardware generated key on our hardware token!

What do you think, is there anything you could do with these problems?

Best Regards,

Jan

Subject: RE: That’s a PKCS#11 driver bug…

as Dave said, that’s really a driver limitation. and there should be a way to insist on cryptoplus fixing that issue (but as always this will depend on costumer size:)

regarding strict company laws: i wonder how e.g. government agency handle that. aren’t there standardized procedures so that hardware generated keys don’t have to be considered a security issue?

do they all do this manually?

by the way, just of interest: how did you automatise all this on client-side?

Markus Seitz

markus.seitz@icodex.com

Subject: RE: That’s a PKCS#11 driver bug…

Hi Markus,

first of all, the law I was talking about is a law of our country, not company. :slight_smile:

Government agencies are packed with M$ products from bottom to roof, so they do not have to worry about this problem with their Outlooks. :frowning: Outlook client accepts hardware generated keys quite fine as far as I know.

BTW, why the hell should be hardware generated SIGNATURE keys considered a security issue? Lost signature key means nothing, just generation of a new one. Nothing is encrypted with it.

On the other hand, possible ‘recovery’ of private signature key by malicious administrator is a REAL nightmare!

And how we did automatise the process? ROTFL! :slight_smile: How could we possibly automatise THIS? We found one quiet corner, one disposable PC, installed the configuration, created full backup of the hard drive and all people who need this certificate simply come and get one. One person = ca. 2 hours. That is why I bothered to complain about that.

All these beautiful recovery features are worth nothing when you really need unrecoverable signature key!

Best Regards

Jan

Subject: Importing hardware-generated keys was added in 6.0.2

BTW, Dave, I guess you are involved in development of this part of Lotus Notes, so I would like to tell you also, that we are experiencing serious problem with the unability of this client to accept hardware generated private key. Our law specifies that user have to have EXCLUSIVE access to the private key used to digitaly sign documents, because documents signed with certificate issued by our accredited CA are equal to hand signed documents according to the law of our country.

Currently we have to generate ID without recovery info, transfer it to a standalone PC, software generate a new key pair, get certificate from our CA, export the certificate from Windows store, import it to the Lotus Notes, move private key into smart card and then wipe entire hard drive of the standalone PC! Incredible work instead of a simple registration of existing hardware generated key on our hardware token!

That does sound like a painful process. Thankfully, you aren’t the first person to come forward with that complaint – we added the ability to “import” a key that was generated in hardware on the token to ND 6.0.2. As long as the RSA private key and the corresponding X.509 certificate are both on the token and have the same unique non-null CKA_ID value (as per the RSA Asymmetric Client Signing Profile in the PKCS#11 Conformance Profile Specification), you’ll be able to import that X.509 cert into your ID file and then use the corresponding RSA private key (that never leaves the hardware token, and so can never be recovered) on the token to perform signing and decryption in the secure hardware.

To perform this import through the GUI, open the User Security Panel, go to the My Identity//My Certificates pane, click on the “Get Certificates” button, and select “Import Internet Certificate From a Smartcard”.

To perform this import through the C API, check out the documentation (or just search this forum) for the SECManipulateSC API function.

In 6.0.2, the ID file needed to be locked with that token for the import to be permitted, but starting in 6.0.5/6.5.3, the import can be performed without first smartcard-enabling the ID file.

thank you for your prompt response. I have consulted this issue with manufacturer of the smart card solution (CryptoPlus, www.cryptoplus.cz) yesterday. They said this was not a bug but a feature.

They share the PKCS#11 label with the Windows CSP API driver and therefore they need this to be unique. This is the unique identifier of the key for them, regardless of API driver used to access the key.

That’s the first token that I’ve heard of that mandates a unique CKA_LABEL attribute. I would not be surprised if the CKA_ID attribute (which is expected but not mandated to be unique for any set of public key/private key/certificate) or a vendor-specific attribute were more commonly used for that purpose.

How do they deal with users changing the CKA_LABEL attribute of their objects? Many of the vendor-provided software packages that I’ve played with display and allow users to change the label on token objects. For that reason, we’ve been phasing out use of the CKA_LABEL attribute over time, but some dependencies on that attribute may still exist for exported (but not imported) keys in 7.0.

What country are you in? We’ve tested against a couple of European eID tokens, and, time and release schedule permitting, would be interested in adding another one to the list.

dave

Subject: RE: Importing hardware-generated keys was added in 6.0.2

These are INCREDIBLY GOOD news, Dave!! I have to hold my desk tight, otherwise I would run around my office and scream like an idiot! Jesus, I am happy! Come to me, I want to give you a big hug! :slight_smile:

I do not have to software generate key pairs on a standalone PC with stupid and untrustworthy M$ key generator anymore! Even better, I do not have to lock IDs to smart cards from now on!! Great, great, GREAT!!!

Thank you for these good news, Dave! I have developed our application on version five dot something and I did not notice these wonderful improvements in Lotus Notes client!

Now to your questions. I live in Czech Republic. This is in the middle of Europe, right next to the Germany and Austria. If you are interested in testing against CryptoPlus hardware token I think I could help with that. I succeeded to persuade manufacturer of the token to support Lotus Notes two years ago (they supported only Netscape and Entrust PKCS#11 API before 2003) and I was their first tester, because they did not have any Lotus Notes configuration available at the time. I know the key people in the company and I can tell them directly, if you are interested.

But I suggest to switch to e-mail, because this is not a public affair anymore. My spam box is at hdub@geocities.com, if you send me a mail there, I will respond from my normal e-mail a we can arrange details then.

Best Regards,

Jan

Subject: Done