LudovicRousseau / PyKCS11

PKCS#11 Wrapper for Python
GNU General Public License v2.0
99 stars 35 forks source link

Sample template for generating P-384 EC keypair #81

Closed kalyank23 closed 4 years ago

kalyank23 commented 4 years ago

Your system information

Please describe your issue in as much detail as possible:

Describe what you expected should happen. Should be able to generate the EC keypair

Describe what did happen. TypeError: in method 'CK_ATTRIBUTE_SMART_SetBin', argument 3 of type 'std::vector< unsigned char > const &'

Steps for reproducing this issue:

  1. We have used the below template to generate key pair [(CKA_CLASS, CKO_PUBLIC_KEY), (CKA_ID, cka_id), (CKA_KEY_TYPE, CKK_EC), (CKA_TOKEN, CK_TRUE), (CKA_PRIVATE, CK_FALSE), (CKA_EC_PARAMS, [('namedCurve', 'secp384r1')])]

Could you let me know how to pass CKA_EC_PARAMS?

LudovicRousseau commented 4 years ago

Have you looked at https://github.com/LudovicRousseau/PyKCS11/blob/master/samples/ec_generate.py ?

manojyadlapalli commented 4 years ago

Thanks, It works now.