Skip to contentSkip to conversation

Loading certificate inside TPM

tpm2 CHOTARD Clement 2 participants 2 messages Jul 9, 2020 – Jul 10, 2020

lore
Share & tools
lore

CHOTARD Clement

author
#0 lore raw

Hi,

I am trying to load a certificate in the TPM through this command:
tpm2pkcs11-tool -l --pin $PIN --write-object "$device_dir/client.der" --type cert --id 01 --label devicecert

I have tried with both .pem and .der format but it triggers the following error:

Using slot 0 with a present token (0x1)
ERROR: Expected attribute CKA_KEY_TYPE
error: PKCS11 function C_CreateObject failed: rv = CKR_TEMPLATE_INCOMPLETE (0xd0) Aborting.

Is it a bug or the feature is yet to be implemented?

Thanks,
Clement

#1 lore raw

The feature is there, or else you would get the not implemented CKR. But it sounds Like the code is not handling the pkcs11-tool template properly. Can you file a bug To the project and I'll get to it. IIRC, I only test against the Java keystore for that feature, So it probably has a different template.

Thanks,
Bill

Quoted 39 lines

-----Original Message-----
From: CHOTARD Clement <clement.chotard(a)thalesgroup.com>
Sent: Thursday, July 9, 2020 8:49 AM
To: tpm2(a)lists.01.org
Subject: [tpm2] Loading certificate inside TPM

Hi,

I am trying to load a certificate in the TPM through this command:

tpm2pkcs11-tool -l --pin $PIN --write-object "$device_dir/client.der" --type cert - -id 01 --label devicecert

I have tried with both .pem and .der format but it triggers the following error:

Using slot 0 with a present token (0x1)

ERROR: Expected attribute CKA_KEY_TYPE

error: PKCS11 function C_CreateObject failed: rv = CKR_TEMPLATE_INCOMPLETE (0xd0)

Aborting.

Is it a bug or the feature is yet to be implemented?

Thanks,

Clement