How to save secure data to SE050

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

How to save secure data to SE050

Jump to solution
2,694 Views
namht
Contributor III

Hi all,

Currenly, i'm working with secure element SE050. 
I readed on SE050's datasheet and found content: "Secured user flash memory up to 50 kB for secure data or key storage".
My question: How to save/read my secure data to flash memory of SE050?

Thanks.

Labels (1)
0 Kudos
Reply
1 Solution
2,638 Views
Kan_Li
NXP TechSupport
NXP TechSupport

Hi @namht ,

 

There is another demo called "se05x_GetCertificate". Please kindly refer to simw-top\demos\se05x\se05x_GetCertificate for details.

 

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.
-------------------------------------------------------------------------------

View solution in original post

7 Replies
2,674 Views
Kan_Li
NXP TechSupport
NXP TechSupport

Hi @namht ,

 

Binary file is a secure object supported by SE050, so you may create a file object at first and store your secure data into it, for example, the device certificate . We provide a demo of se05x_InjectCertificate for that purpose. You may find this demo within the MW: https://www.nxp.com/webapp/Download?colCode=SE05x-PLUG-TRUST-MW&appType=license .

 

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.
-------------------------------------------------------------------------------

2,645 Views
namht
Contributor III
Hi Kan,
Thank you for reply.
I tried following the example, but i don't know how to read back it again.
I tried "sss_key_store_get_key()" and return status = kStatus_SSS_Fail
0 Kudos
Reply
2,639 Views
Kan_Li
NXP TechSupport
NXP TechSupport

Hi @namht ,

 

There is another demo called "se05x_GetCertificate". Please kindly refer to simw-top\demos\se05x\se05x_GetCertificate for details.

 

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.
-------------------------------------------------------------------------------

2,618 Views
namht
Contributor III

Hi @Kan_Li 

I tried demo of "se05x_InjectCertificate" for save data to SE050 and "se05x_GetCertificate" for read back this data from SE050 successly. Howerver, my secure data can be leak if anyone try  "brute force" keyID for get data, rights?

And, I tried a demo of "se05x_Minimal" for gets available memory from secure element. I see before and after Inject Certificate, Se05x_API_GetFreeMemory() return pfreeMem = 32767. Why available memory of SE050 not change?

 
0 Kudos
Reply
2,605 Views
Kan_Li
NXP TechSupport
NXP TechSupport

Hi @namht ,

 

Yes, it is possible so we recommend binging with your host in real application, please kindly refer to https://www.nxp.com/docs/en/application-note/AN12662.pdf for details.

 

Actually the mem size should change, but I am not sure if you have enabled the following definition so the application deleted all custom defined secure objects from the beginning of the demo.

Kan_Li_0-1727248821234.png

 

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.
-------------------------------------------------------------------------------

 

2,602 Views
namht
Contributor III

I call ex_sss_boot_factory_reset() → Se05x_API_GetFreeMemory() → InjectCertificate → Se05x_API_GetFreeMemory() .

Log :

App :INFO :mem=32767
App :INFO :Inject certificate example
App :INFO :Injecting ECC certificate at 0x00000014
App :INFO :mem=32767

0 Kudos
Reply
2,592 Views
Kan_Li
NXP TechSupport
NXP TechSupport

Hi @namht ,

 

Is it possible to turn on the verbose log level? so I may have the APDU command log for analyzation. 

Kan_Li_0-1727328799825.png

 

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.
-------------------------------------------------------------------------------

 

 

%3CLINGO-SUB%20id%3D%22lingo-sub-1957639%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3EHow%20to%20save%20secure%20data%20to%20SE050%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1957639%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3E%3CP%3EHi%20all%2C%3C%2FP%3E%3CP%3ECurrenly%2C%20i'm%20working%20with%20secure%20element%20SE050.%26nbsp%3B%3CBR%20%2F%3EI%20readed%20on%20SE050's%20datasheet%20and%20found%20content%3A%20%22Secured%20user%20flash%20memory%20up%20to%2050%20kB%20for%20secure%20data%20or%20key%20storage%22.%3CBR%20%2F%3EMy%20question%3A%20How%20to%20save%2Fread%20my%20secure%20data%20to%20flash%20memory%20of%20SE050%3F%3C%2FP%3E%3CP%3EThanks.%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-LABS%20id%3D%22lingo-labs-1957639%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3E%3CLINGO-LABEL%3Ei.MXRT%20106x%3C%2FLINGO-LABEL%3E%3C%2FLINGO-LABS%3E%3CLINGO-SUB%20id%3D%22lingo-sub-1962280%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3ERe%3A%20How%20to%20save%20secure%20data%20to%20SE050%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1962280%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3E%3CP%3EHi%26nbsp%3B%3CA%20href%3D%22https%3A%2F%2Fcommunity.nxp.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F185174%22%20target%3D%22_blank%22%3E%40namht%3C%2FA%3E%26nbsp%3B%2C%3C%2FP%3E%0A%3CBR%20%2F%3E%0A%3CP%3EIs%20it%20possible%20to%20turn%20on%20the%20verbose%20log%20level%3F%20so%20I%20may%20have%20the%20APDU%20command%20log%20for%20analyzation.%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20image-alt%3D%22Kan_Li_0-1727328799825.png%22%20style%3D%22width%3A%20624px%3B%22%3E%3Cspan%20class%3D%22lia-inline-image-display-wrapper%22%20image-alt%3D%22Kan_Li_0-1727328799825.png%22%20style%3D%22width%3A%20624px%3B%22%3E%3Cimg%20src%3D%22https%3A%2F%2Fcommunity.nxp.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F301339iB65615FE07DE7ACD%2Fimage-dimensions%2F624x313%3Fv%3Dv2%22%20width%3D%22624%22%20height%3D%22313%22%20role%3D%22button%22%20title%3D%22Kan_Li_0-1727328799825.png%22%20alt%3D%22Kan_Li_0-1727328799825.png%22%20%2F%3E%3C%2Fspan%3E%3C%2FSPAN%3E%3C%2FP%3E%0A%3CBR%20%2F%3E%0A%3CP%3EHave%20a%20great%20day%2C%3CBR%20%2F%3EKan%3C%2FP%3E%0A%3CP%3E%3CBR%20%2F%3E-------------------------------------------------------------------------------%3CBR%20%2F%3ENote%3A%3CBR%20%2F%3E-%20If%20this%20post%20answers%20your%20question%2C%20please%20click%20the%20%22Mark%20Correct%22%20button.%20Thank%20you!%3CBR%20%2F%3E-%20We%20are%20following%20threads%20for%207%20weeks%20after%20the%20last%20post%2C%20later%20replies%20are%20ignored%3CBR%20%2F%3EPlease%20open%20a%20new%20thread%20and%20refer%20to%20the%20closed%20one%2C%20if%20you%20have%20a%20related%20question%20at%20a%20later%20point%20in%20time.%3CBR%20%2F%3E-------------------------------------------------------------------------------%3C%2FP%3E%0A%3CBR%20%2F%3E%0A%3CBR%20%2F%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-1961499%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3ERe%3A%20How%20to%20save%20secure%20data%20to%20SE050%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1961499%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3E%3CP%3EI%20call%20%3CSTRONG%3Eex_sss_boot_factory_reset()%26nbsp%3B%E2%86%92%3C%2FSTRONG%3E%26nbsp%3B%3CSPAN%3E%3CSTRONG%3ESe05x_API_GetFreeMemory()%3C%2FSTRONG%3E%26nbsp%3B%E2%86%92%26nbsp%3B%3CSTRONG%3EInjectCertificate%3C%2FSTRONG%3E%26nbsp%3B%E2%86%92%26nbsp%3B%3CSTRONG%3ESe05x_API_GetFreeMemory()%26nbsp%3B%3C%2FSTRONG%3E.%20%3C%2FSPAN%3E%3C%2FP%3E%3CP%3E%3CSPAN%3ELog%20%3A%3C%2FSPAN%3E%3C%2FP%3E%3CP%3EApp%20%3AINFO%20%3Amem%3D32767%3CBR%20%2F%3EApp%20%3AINFO%20%3AInject%20certificate%20example%3CBR%20%2F%3EApp%20%3AINFO%20%3AInjecting%20ECC%20certificate%20at%200x00000014%3CBR%20%2F%3EApp%20%3AINFO%20%3Amem%3D32767%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-1961446%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3ERe%3A%20How%20to%20save%20secure%20data%20to%20SE050%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1961446%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3E%3CP%3EHi%26nbsp%3B%3CA%20href%3D%22https%3A%2F%2Fcommunity.nxp.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F185174%22%20target%3D%22_blank%22%3E%40namht%3C%2FA%3E%26nbsp%3B%2C%3C%2FP%3E%0A%3CBR%20%2F%3E%0A%3CP%3EYes%2C%20it%20is%20possible%20so%20we%20recommend%20binging%20with%20your%20host%20in%20real%20application%2C%20please%20kindly%20refer%20to%26nbsp%3B%3CA%20href%3D%22https%3A%2F%2Fwww.nxp.com%2Fdocs%2Fen%2Fapplication-note%2FAN12662.pdf%22%20target%3D%22_blank%22%20rel%3D%22nofollow%20noopener%20noreferrer%22%3Ehttps%3A%2F%2Fwww.nxp.com%2Fdocs%2Fen%2Fapplication-note%2FAN12662.pdf%3C%2FA%3E%26nbsp%3Bfor%20details.%3C%2FP%3E%0A%3CBR%20%2F%3E%0A%3CP%3EActually%20the%20mem%20size%20should%20change%2C%20but%20I%20am%20not%20sure%20if%20you%20have%20enabled%20the%20following%20definition%20so%20the%20application%20deleted%20all%20custom%20defined%20secure%20objects%20from%20the%20beginning%20of%20the%20demo.%3C%2FP%3E%0A%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20image-alt%3D%22Kan_Li_0-1727248821234.png%22%20style%3D%22width%3A%20600px%3B%22%3E%3Cspan%20class%3D%22lia-inline-image-display-wrapper%22%20image-alt%3D%22Kan_Li_0-1727248821234.png%22%20style%3D%22width%3A%20600px%3B%22%3E%3Cimg%20src%3D%22https%3A%2F%2Fcommunity.nxp.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F301120i7E9A109224D96B43%2Fimage-dimensions%2F600x159%3Fv%3Dv2%22%20width%3D%22600%22%20height%3D%22159%22%20role%3D%22button%22%20title%3D%22Kan_Li_0-1727248821234.png%22%20alt%3D%22Kan_Li_0-1727248821234.png%22%20%2F%3E%3C%2Fspan%3E%3C%2FSPAN%3E%3C%2FP%3E%0A%3CBR%20%2F%3E%0A%3CP%3EHave%20a%20great%20day%2C%3CBR%20%2F%3EKan%3C%2FP%3E%0A%3CP%3E%3CBR%20%2F%3E-------------------------------------------------------------------------------%3CBR%20%2F%3ENote%3A%3CBR%20%2F%3E-%20If%20this%20post%20answers%20your%20question%2C%20please%20click%20the%20%22Mark%20Correct%22%20button.%20Thank%20you!%3CBR%20%2F%3E-%20We%20are%20following%20threads%20for%207%20weeks%20after%20the%20last%20post%2C%20later%20replies%20are%20ignored%3CBR%20%2F%3EPlease%20open%20a%20new%20thread%20and%20refer%20to%20the%20closed%20one%2C%20if%20you%20have%20a%20related%20question%20at%20a%20later%20point%20in%20time.%3CBR%20%2F%3E-------------------------------------------------------------------------------%3C%2FP%3E%0A%3CBR%20%2F%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-1961287%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3ERe%3A%20How%20to%20save%20secure%20data%20to%20SE050%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1961287%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3E%3CP%3EHi%26nbsp%3B%3CA%20href%3D%22https%3A%2F%2Fcommunity.nxp.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F59276%22%20target%3D%22_blank%22%3E%40Kan_Li%3C%2FA%3E%26nbsp%3B%3C%2FP%3E%3CP%3EI%20tried%20demo%20of%20%22%3CSPAN%3E%3CSTRONG%3Ese05x_InjectCertificate%3C%2FSTRONG%3E%22%20for%20save%20data%20to%20SE050%20and%20%22%3CSTRONG%3Ese05x_GetCertificate%3C%2FSTRONG%3E%22%20for%20read%20back%20this%20data%20from%20SE050%20successly.%20Howerver%2C%20my%20secure%20data%20can%20be%20leak%20if%20anyone%20try%26nbsp%3B%20%22brute%20force%22%20keyID%20for%20get%20data%2C%20rights%3F%3C%2FSPAN%3E%3C%2FP%3E%3CP%3E%3CSPAN%3EAnd%2C%20I%20tried%20a%20demo%20of%20%22%3CSTRONG%3Ese05x_Minimal%3C%2FSTRONG%3E%22%20for%26nbsp%3B%3C%2FSPAN%3E%3CSPAN%3Egets%20available%20memory%20from%20secure%20element.%20I%20see%26nbsp%3Bbefore%20and%26nbsp%3Bafter%20Inject%20Certificate%2C%26nbsp%3BSe05x_API_GetFreeMemory()%20return%26nbsp%3BpfreeMem%20%3D%2032767.%20Why%20available%20memory%20of%20SE050%20not%20change%3F%3C%2FSPAN%3E%3C%2FP%3E%3CDIV%3E%3CDIV%20class%3D%22%22%3E%26nbsp%3B%3C%2FDIV%3E%3C%2FDIV%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-1960502%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3ERe%3A%20How%20to%20save%20secure%20data%20to%20SE050%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1960502%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3E%3CP%3EHi%26nbsp%3B%3CA%20href%3D%22https%3A%2F%2Fcommunity.nxp.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F185174%22%20target%3D%22_blank%22%3E%40namht%3C%2FA%3E%26nbsp%3B%2C%3C%2FP%3E%0A%3CBR%20%2F%3E%0A%3CP%3EThere%20is%20another%20demo%20called%20%22%3CSPAN%3Ese05x_GetCertificate%3C%2FSPAN%3E%22.%20Please%20kindly%20refer%20to%26nbsp%3Bsimw-top%5Cdemos%5Cse05x%5Cse05x_GetCertificate%20for%20details.%3C%2FP%3E%0A%3CBR%20%2F%3E%0A%3CP%3EHave%20a%20great%20day%2C%3CBR%20%2F%3EKan%3C%2FP%3E%0A%3CP%3E%3CBR%20%2F%3E-------------------------------------------------------------------------------%3CBR%20%2F%3ENote%3A%3CBR%20%2F%3E-%20If%20this%20post%20answers%20your%20question%2C%20please%20click%20the%20%22Mark%20Correct%22%20button.%20Thank%20you!%3CBR%20%2F%3E-%20We%20are%20following%20threads%20for%207%20weeks%20after%20the%20last%20post%2C%20later%20replies%20are%20ignored%3CBR%20%2F%3EPlease%20open%20a%20new%20thread%20and%20refer%20to%20the%20closed%20one%2C%20if%20you%20have%20a%20related%20question%20at%20a%20later%20point%20in%20time.%3CBR%20%2F%3E-------------------------------------------------------------------------------%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-1960235%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3ERe%3A%20How%20to%20save%20secure%20data%20to%20SE050%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1960235%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3EHi%20Kan%2C%3CBR%20%2F%3EThank%20you%20for%20reply.%3CBR%20%2F%3EI%20tried%20following%20the%20example%2C%20but%20i%20don't%20know%20how%20to%20read%20back%20it%20again.%3CBR%20%2F%3EI%20tried%20%22sss_key_store_get_key()%22%20and%20return%20status%20%3D%20kStatus_SSS_Fail%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-1958429%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3ERe%3A%20How%20to%20save%20secure%20data%20to%20SE050%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1958429%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3E%3CP%3EHi%26nbsp%3B%3CA%20href%3D%22https%3A%2F%2Fcommunity.nxp.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F185174%22%20target%3D%22_blank%22%3E%40namht%3C%2FA%3E%26nbsp%3B%2C%3C%2FP%3E%0A%3CBR%20%2F%3E%0A%3CP%3EBinary%20file%20is%20a%20secure%20object%20supported%20by%20SE050%2C%20so%20you%20may%20create%20a%20file%20object%20at%20first%20and%20store%20your%20secure%20data%20into%20it%2C%20for%20example%2C%20the%20device%20certificate%20.%20We%20provide%20a%20demo%20of%20%3CSPAN%3Ese05x_InjectCertificate%26nbsp%3B%3C%2FSPAN%3Efor%20that%20purpose.%20You%20may%20find%20this%20demo%20within%20the%20MW%3A%26nbsp%3B%3CA%20href%3D%22https%3A%2F%2Fwww.nxp.com%2Fwebapp%2FDownload%3FcolCode%3DSE05x-PLUG-TRUST-MW%26amp%3BappType%3Dlicense%22%20target%3D%22_blank%22%20rel%3D%22nofollow%20noopener%20noreferrer%22%3Ehttps%3A%2F%2Fwww.nxp.com%2Fwebapp%2FDownload%3FcolCode%3DSE05x-PLUG-TRUST-MW%26amp%3BappType%3Dlicense%3C%2FA%3E%26nbsp%3B.%3C%2FP%3E%0A%3CBR%20%2F%3E%0A%3CP%3EHope%20that%20helps%2C%3C%2FP%3E%0A%3CBR%20%2F%3E%0A%3CP%3EHave%20a%20great%20day%2C%3CBR%20%2F%3EKan%3C%2FP%3E%0A%3CP%3E%3CBR%20%2F%3E-------------------------------------------------------------------------------%3CBR%20%2F%3ENote%3A%3CBR%20%2F%3E-%20If%20this%20post%20answers%20your%20question%2C%20please%20click%20the%20%22Mark%20Correct%22%20button.%20Thank%20you!%3CBR%20%2F%3E-%20We%20are%20following%20threads%20for%207%20weeks%20after%20the%20last%20post%2C%20later%20replies%20are%20ignored%3CBR%20%2F%3EPlease%20open%20a%20new%20thread%20and%20refer%20to%20the%20closed%20one%2C%20if%20you%20have%20a%20related%20question%20at%20a%20later%20point%20in%20time.%3CBR%20%2F%3E-------------------------------------------------------------------------------%3C%2FP%3E%3C%2FLINGO-BODY%3E