Giter Site home page Giter Site logo

fio-se05x-cli's Introduction

Foundries.io NXP SE05X Secure Element CLI

Intro and Usage

This Secured Utility currently allows the user to import pre-provisioned certificates from the NXP SE050/51 via OP-TEE into the pkcs#11 database associated to one of its tokens. It also allows the user to list all objects stored in the NXP SE05X non volatile memory (NVM) and to delete those objects that were created by the Secure World (not the pre-provisioned objects)

If SCP03 was enabled, OP-TEE will take care of encrypt/decrypt and MAC authenticate the APDUs shared between the processor and the secure element.

Data flow by exception level executing in an ARM host:

EL0:

[User space]
Prepares raw APDU frames, Sends the frames to S-EL1.

S-EL1:

[OP-TEE]
AES-GCM encryption of the APDU with the SCP03 session keys. Sends the APDU request to EL1.

EL1:

[Linux kernel]
Transmit the APDU to the I2C bus and receives a response from the I2C secure element device (NXP SE05X).Forwards the response to S-EL1.

S-EL1:

[OP-TEE]
AES-GCM decryption and authentication of the response. Sends the data to EL0.

EL0:

[User space]
Processes the response.

System Configuration

  • OP-TEE must enable the APDU PTA and the NXP SE05x cryptographic driver.
  • The Linux kernel must enable I2C support: the DTB must make sure that the NXP SE05x device is on the I2C bus configured in OP-TEE. That usually requires an alias.

For example if OP-TEE configured CFG_CORE_SE05X_I2C_BUS=6, the Linux kernel dts should contain aliases { i2c6 = &i2c6;};

Examples of usage

  • Import NXP SE051 Certficate with the id 0xf0000123 into OP-TEE pkcs#11 'aktualizr' token storage:

    fio-se05x-cli --token-label aktualizr --import-cert 0xf0000123 --id 45 --label fio
  • Show NXP SE050 Certficate with the id 0xf0000123 on the console:

    fio-se05x-cli --show-cert 0xf0000123 --se050
  • Import NXP SE051 RSA:2048 bits key with the id 0xf0000123 into OP-TEE pkcs#11 'aktualizr' token storage:

    fio-se05x-cli --token-label aktualizr --import-key 0xf0000123 --id 45 --key-type RSA:2048 --pin 87654321
  • List NXP SE050 objects and optionally show any associated labels when they are being used by PKCS#11:

    fio-se05x-cli --list-objects all
    fio-se05x-cli --list-objects 0xf0000123
    fio-se05x-cli --list-objects all --token-label aktualizr --pin 87654321
    fio-se05x-cli --list-objects 0xf0000123 --token-label aktualizr --pin 87654321
  • Delete objects:

    fio-se05x-cli --factory-reset
    fio-se05x-cli --delete-objects all
    fio-se05x-cli --delete-objects 0x67981234
  • Show the SE05X Unique Identifier:

    fio-se05x-cli --getuid

Use the optional --se050 if the device is an SE050

Have fun:

_  _
/ |
____/
 o o| Thumbs Up

_____| _____ | | | | | | | | | |

Foundries.io

NOTE: Due to unclear Copyright ownership in AI generated code, contributions using these tools will not be accepted in this repository

fio-se05x-cli's People

Contributors

ldts avatar

Watchers

Andy Doan avatar James Cloos avatar 0x1 avatar Daiane Angolini avatar David Griego avatar Jose Quaresma avatar  avatar Mike Sul avatar Katrina Prosise avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.