Re: [opensc-devel] question about C_CreateObject

2009-07-10 Thread Douglas E. Engert
The real question is, are you using PKCS#11 to create a private key on a token such that it can not be read of the token? Sounds like no, as you want to read the private key. So then is it important to use PKCS#11 with some token behind it? If you are just trying to generate a key pair, you could

Re: [opensc-devel] question about C_CreateObject

2009-07-10 Thread Martin Paljak
You can check out src/tools/pkcs11-tool.c in opensc source to see how pkcs11-tool uses the call with opensc. On 7/10/09, erbalibera erbalibera wrote: > Hi, thanks for you reply. > > What I do is: > > 1. generate a RSA key pair using C_GenerateKeyPair with the following > template: > > > 64 CK_A

Re: [opensc-devel] question about C_CreateObject

2009-07-10 Thread erbalibera erbalibera
Hi, thanks for you reply. What I do is: 1. generate a RSA key pair using C_GenerateKeyPair with the following template: 64 CK_ATTRIBUTE publicKeyAttr[] = { 65 66 {CKA_TOKEN, &true_, sizeof(true_)}, 67 {CKA_ENCRYPT, &true_, sizeof (true_)}, 68 {CKA_VERIFY, &true_,

Re: [opensc-devel] question about C_CreateObject

2009-07-10 Thread Douglas E. Engert
erbalibera erbalibera wrote: > Hi guys, > >pkcs11 documentation , says that C_CreateObject could be used to > create a key object. In the documention example, the key template is > > CK_BYTE modulus[] = {...}; > > CK_ATTRIBUTE keyTemplate[] = { > > {CKA_CLASS, &keyClass, sizeof(keyClas

[opensc-devel] question about C_CreateObject

2009-07-10 Thread erbalibera erbalibera
Hi guys, pkcs11 documentation , says that C_CreateObject could be used to create a key object. In the documention example, the key template is CK_BYTE modulus[] = {...}; CK_ATTRIBUTE keyTemplate[] = { {CKA_CLASS, &keyClass, sizeof(keyClass)}, {CKA_KEY_TYPE, &keyType, sizeof(keyType)}, {CK