gnome-keyring How to get the private fields of a private key using gck.



Hi All,

           I'm testing gnome-keyring module(especially pkcs11 stuff using GCK) on my desktop.
I'm unable to get the private fields of a private key
(After looking in to the code, i found that while requesting for any private field of a private key, it simply returns "CKR_ATTRIBUTE_SENSITIVE" ).

(According to pkcs11 document, we can get private fields, if we set sensitive attribute as FALSE, Please correct me if i'm wrong.)
so, i tried to add a private key by setting the sensitive attribute as FALSE.
gck_attributes_add_boolean (attrs, CKA_SENSITIVE, CK_FALSE);
But we are getting the following error while adding a private key by setting the sensitive field as false.
 "The operation failed".

After that i tried to modify the code of the function "gkm_private_xsa_key_real_get_attribute" in the file "gkm-private-xsa-key.c".

       case CKA_PRIVATE_EXPONENT:
                return gkm_sexp_key_set_part (GKM_SEXP_KEY (self), GCRY_PK_RSA, "d", attr);

        case CKA_PRIME_1:
                return gkm_sexp_key_set_part (GKM_SEXP_KEY (self), GCRY_PK_RSA, "p", attr);

        case CKA_PRIME_2:
                return gkm_sexp_key_set_part (GKM_SEXP_KEY (self), GCRY_PK_RSA, "q", attr);

        case CKA_COEFFICIENT:
                return gkm_sexp_key_set_part (GKM_SEXP_KEY (self), GCRY_PK_RSA, "u", attr);

After changing the code as above, i'm able to access the private fields,
but the problem is after restarting the "gnome-keyring-daemon", we are unable to access the private fields.

Please help me how to get the private fields of a private key.


Thanks,
Ravi Krishna.




[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]