Generate RSA Key pair SE050

キャンセル
次の結果を表示 
表示  限定  | 次の代わりに検索 
もしかして: 

Generate RSA Key pair SE050

ソリューションへジャンプ
2,895件の閲覧回数
ninomedj
Contributor I

Hi everyone, i want to generate an RSA key pair, im using AN12413 WriteRsaKey Apdu:

ninomedj_0-1649834763234.png

but i find it hard to construct the apdu  especially the policy part, for example if i took an APDU that  @nicolaponzevero constructed from his post:

https://community.nxp.com/t5/Secure-Authentication/SE050-Reading-the-modulus-of-an-RSA-KEY-PAIR-CRT-...

[15:23:31.118]:[DEBUG] SEND [31] APDU_DATA  80 01 62 00 1A 11 09 08 00 00 00 00 00 24 00 00 41 04 70 70 70 70 42 02 02 00 48 03 01 00 01.

for example the P1 field that represent the key type should be 0x60 to define a key pair but here its 0x62, also i didn't understand how to construct the policy filed in this case: 08 00 00 00 00 00 24 00 00, and finally in TAG2 where we define the key size in this case 512=0x200, so why there's another 0x02 before 0x02 0x00.

Im sorry if there's a lot of questions, but i hope you can help me understand better, thank you.

 

 

 

0 件の賞賛
返信
1 解決策
2,869件の閲覧回数
Kan_Li
NXP TechSupport
NXP TechSupport

Hi @ninomedj ,

 

Actually SE050 IoT applet defines APDUs according to ISO - ISO/IEC 7816-4:2013 - Identification cards — Integrated circuit cards — Part 4: Organization, ...

so please kindly fetch the above spec before going on.

 

Also NXP provide a Nano version package which doesn't contain so high level functions as the MW,  and it just consumes ~1KB SRAM of the host controller, so if your project has memory constraint , you may use this package instead to speed up your development . Please refer to https://github.com/NXPPlugNTrust/nano-package for more details.

 

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 件の賞賛
返信
3 返答(返信)
2,890件の閲覧回数
Kan_Li
NXP TechSupport
NXP TechSupport

Hi @ninomedj ,

 

Indeed it is always recommended to build your application based on the MW where you may easily find docs for the topics you are looking for.

How to construct the policy: Please refer to "simw-top/doc/demos/se05x/se05x_policy/Readme.html " for details.

Create APDU commands directly if your application just needs some of them: Please refer to "simw-top/doc/demos/se05x/se05x_GetAPDUBuffer/Readme.html" for details.

 

A ready to use RSA demo: Please refer to "simw-top/doc/sss/ex/rsa/readme.html" for details.

 

You may download the latest version from https://www.nxp.com/webapp/Download?colCode=SE-PLUG-TRUST-MW_04.01.01&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.
-------------------------------------------------------------------------------

0 件の賞賛
返信
2,886件の閲覧回数
ninomedj
Contributor I

Hi @Kan_Li,

Thank you for your answer, for my use case i want devellope the APDU by my own, so high level function will not work for me, this is why im asking about more information on the APDU, i checked already the doc, demos and examples and they all depend on high level layers (sss , MW), so i want understand more on the APDU construction for example if i try to create an AES key is this apdu correct :

uint8_t apdu[26]={0x80,0x01,0x03,0x00,0x1A,0x11,0x09,0x08,0x00,0x00,0x00,0x00,0x00,0x24,0x00,0x00,0x12,0x00,0x00,0x41,0x09,0x70,0x70,0x70,0x72,};

Have a great day.

0 件の賞賛
返信
2,870件の閲覧回数
Kan_Li
NXP TechSupport
NXP TechSupport

Hi @ninomedj ,

 

Actually SE050 IoT applet defines APDUs according to ISO - ISO/IEC 7816-4:2013 - Identification cards — Integrated circuit cards — Part 4: Organization, ...

so please kindly fetch the above spec before going on.

 

Also NXP provide a Nano version package which doesn't contain so high level functions as the MW,  and it just consumes ~1KB SRAM of the host controller, so if your project has memory constraint , you may use this package instead to speed up your development . Please refer to https://github.com/NXPPlugNTrust/nano-package for more details.

 

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 件の賞賛
返信