Does any WriteBinary example exist?

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Does any WriteBinary example exist?

1,062 Views
simon_ger
Contributor I

Hi,

for quick evalution it would be fine to write and read binary files to/from SE050 (to get a whole chain of instructions manually run).

I can´t find any example program or ssscli command to do so.

Is there any program/ssscli command available? If not, could you provide one?

0 Kudos
3 Replies

1,047 Views
Kan_Li
NXP TechSupport
NXP TechSupport

Hi @simon_ger ,

 

Actually there is an MW example for this function, and you may find it in the demo of "C:\se050_middleware\simw-top\demos\se05x\se05x_Delete_and_test_provision", the code is something as below:

se050 write binary demo.png

 

Hope that helps,

 

Have a great day,
Kan


-------------------------------------------------------------------------------
Note:
- If this post answers your question, please click the "Mark Correct" button. Thank you!
- We are following threads for 7 weeks after the last post, later replies are ignored
Please open a new thread and refer to the closed one, if you have a related question at a later point in time.
-------------------------------------------------------------------------------

0 Kudos

1,039 Views
simon_ger
Contributor I

@Kan_LiThanks!

Sorry, my first post was not very precise: I would like to have a example program which I can pass my own binary file to. E.g. like cmd-line parameter.

Is there any?

It would be fine to be able to "play" a whole chain of steps just by example programs (i.e. write data, gen keys, do signing, read, verify). So we could do the whole steps once manually for evaluation.

0 Kudos

967 Views
Kan_Li
NXP TechSupport
NXP TechSupport

Hello @simon_ger ,

 

WriteBinary is e.g. used in ssscli to store a certificate on the SE:

ssscli set cert [keyid] [cert] 

on example se05x_InjectCertificate here sss_key_store_set_key is used with the type of an binary (kSSS_CipherType_Binary) which ends up writing it as binary as well:

LOG_I("Injecting ECC certificate at 0x%08X", ecc_object_id);
status =
sss_key_store_set_key(&pCtx->ks, &ecc_cert_object, ecc_cert, sizeof(ecc_cert), sizeof(ecc_cert) * 8, NULL, 0);

On example se05x_delete_and_test_provision the underlying API to write a binary is directly called:

sw_status = Se05x_API_WriteBinary(&pSession->s_ctx,
NULL,
kSE05x_AppletResID_UNIQUE_ID,
0,
(uint16_t)uidLen,
const_uid,
uidLen);

Hope that helps,

Have a great day,
Kan


-------------------------------------------------------------------------------
Note:
- If this post answers your question, please click the "Mark Correct" button. Thank you!
- We are following threads for 7 weeks after the last post, later replies are ignored
Please open a new thread and refer to the closed one, if you have a related question at a later point in time.
-------------------------------------------------------------------------------

0 Kudos