PDF签名PKCS11_get_private_key返回NULL

时间:2019-03-25 21:34:00

标签: ssl openssl x509certificate pkcs#11

我试图在Linux Mint中使用电子令牌对pdf文件进行签名。

这是提示:

当我跑步时:

Uncaught TypeError: Cannot read property 'name' of undefined at component (app.js:141) at mountIndeterminateComponent (react-dom.development.js:8574) at beginWork (react-dom.development.js:8978) at performUnitOfWork (react-dom.development.js:11814) at workLoop (react-dom.development.js:11843) at HTMLUnknownElement.callCallback (react-dom.development.js:100) at Object.invokeGuardedCallbackDev (react-dom.development.js:138) at invokeGuardedCallback (react-dom.development.js:187) at replayUnitOfWork (react-dom.development.js:11318) at renderRoot (react-dom.development.js:11885)

我得到了:

openssl engine pkcs11 -t -c

我认为可以吗?在其他提示下,我看到了

(pkcs11) pkcs11 engine
     [RSA]
        [ available ]

我正在寻找正确识别包含私钥的对象的名称和类型。

[RSA, rsaEncryption, id-ecPublicKey].

我有

pkcs11-tool --module /usr/lib/libeTPkcs11.so --login -O

所以......

Using slot 0 with a present token (0x0)
Logging in to "Mi dispositivo".
Please enter User PIN: 
Certificate Object; type = X.509 cert
label:
Certificate Object; type = X.509 cert
 label: 
Private Key Object; RSA
label: 
ID:         ee0318bc9438a2be
Usage:      decrypt, sign, unwrap
Certificate Object; type = X.509 cert
label:      le-8ee1d222-1107-4c62-b6bf-655d5408b49a
 ID:         ee0318bc9438a2be

我得到了

openssl pkeyutl -sign -keyform ENGINE -engine pkcs11 -inkey "pkcs11:id=ee0318bc9438a2be;type=private;pin-value=password" -in prueba.pdf -out prueba_firmado.pdf

我试图用令牌的URI读取私钥。...和“ slot_id”方法都给我相同的结果。

为什么pkcs11引擎说“找不到对象”?

感谢您抽出宝贵时间阅读我的问题的建议!。

0 个答案:

没有答案