On 10/7/2014 1:20 AM, helpcrypto helpcrypto wrote:
On Tue, Oct 7, 2014 at 10:02 AM, Sean Leonard <dev+mozi...@seantek.com>
wrote:

Thanks, but the need is to change the nickname. It is displayed in Mozilla
apps for various purposes. The nickname is also known as the "friendly
name" on other platforms (e.g., MS CryptoAPI) and in other standards (e.g.,
PKCS #9).

The nickname is the CKA_LABEL (0x00000003) attribute. That is exactly what
NSS maps it to (see the implementation of PK11_SetObjectNickname), and for
good reason. See pkcs11t.h and PKCS #11 v2.20 Section 10.4. Note that
CKA_LABEL is defined as a UTF-8 encoded string.


Oh, I see. Then you could use C_G/SetAttributeValue with CKA_LABEL, isnt it?

Yes, that is what the code that I wrote does:
PK11_SETATTRS CKA_LABEL
lock session/get rwsession  (more-or-less PK11_GetRWSession)
 C_OpenSession
C_SetAttributeValue
 C_CloseSession             (more-or-less PK11_RestoreROSession)
unlock session

Sean
--
dev-tech-crypto mailing list
dev-tech-crypto@lists.mozilla.org
https://lists.mozilla.org/listinfo/dev-tech-crypto

Reply via email to