Need help using M2Crypto.Engine to access USB Token

前端 未结 6 752
自闭症患者
自闭症患者 2021-01-07 00:09

I am using M2Crypto-0.20.2. I want to use engine_pkcs11 from the OpenSC project and the Aladdin PKI client for token based authentication making xmlrpc calls over ssl.

6条回答
  •  萌比男神i
    2021-01-07 01:04

    I tried the code that Heikki suggested (minus one line) and got the same error as Erlo. For load_private_key(), how do I know what to put in for the argument?

    dynamic = Engine.load_dynamic_engine("pkcs11", "/usr/local/ssl/lib/engines/engine_pkcs11.so")
    #  m2.engine_free(dynamic) this line gave me an error TypeError: in method 'engine_free', argument 1 of type 'ENGINE *'
    
    pkcs11 = Engine.Engine("pkcs11")
    pkcs11.ctrl_cmd_string("MODULE_PATH", "/usr/lib/libeTPkcs11.so")
    
    r = pkcs11.ctrl_cmd_string("PIN", "password")
    
    key = pkcs11.load_private_key("id_01")
    

提交回复
热议问题