X-CUBE-LOGO

X-CUBE-STSE01 የሶፍትዌር ጥቅል

X-CUBE-STSE-Software-Package (4)

መግቢያ

This user manual describes how to get started with the X-CUBE-STSE01 software package.
The X-CUBE-STSE01 software package is a software component that provides several demonstration codes, which use the STSAFE-A110 and STSAFE-A120 device features from a host microcontroller.
These demonstration codes utilize the STSELib (Secured Element middleware) built on the STM32Cube software technology to ease portability across different STM32 microcontrollers. In addition, it is MCU-agnostic for portability to other MCUs.
These demonstration codes illustrate the following features:

  • Authentication.
  • Secured data storage.
  • Secured usage counter.
  • ማጣመር.
  • Key establishment.
  • Local envelope wrapping.
  • Key pair generation.

አጠቃላይ መረጃ

  • The X-CUBE-STSE01 software package is a reference to integrate the STSAFE-A110 and STSAFE-A120 secure element services into a host MCU’s operating system (OS) and its application.
  • It contains the STSAFE-A110 and STSAFE-A120 driver and demonstration codes to be executed on STM32 32-bit microcontrollers based on the Arm® Cortex®-M processor.
  • አርም በUS እና/ወይም በሌላ ቦታ የተመዘገበ የ Arm Limited (ወይም ተባባሪዎቹ) የንግድ ምልክት ነው።
  • The X-CUBE-STSE01 software package is developed in ANSI C. Nevertheless, the platform-independent architecture allows easy portability to a variety of different platforms.
  • The table below presents the definition of acronyms that are relevant for a better understanding of this document.

STSAFE-A1x0 ደህንነቱ የተጠበቀ አካል

STSAFE-A110 እና STSAFE-A120 ለአካባቢያዊ ወይም የርቀት አስተናጋጅ የማረጋገጫ እና የውሂብ አስተዳደር አገልግሎቶችን እንደ አስተማማኝ አካል የሚያገለግል በጣም ደህንነቱ የተጠበቀ መፍትሄ ናቸው። የቅርብ ጊዜውን ደህንነታቸው በተጠበቁ ማይክሮ ተቆጣጣሪዎች ላይ የሚሰራ ደህንነቱ የተጠበቀ ኦፕሬቲንግ ሲስተም ያለው ሙሉ የመዞሪያ መፍትሄን ያካትታል።
The STSAFE-A110 and STSAFE-A120 can be integrated in IoT (Internet of things) devices, smart-home, smart-city and industrial applications, consumer electronics devices, consumables and accessories. Its key features are

  • ማረጋገጫ (የጎራዎች፣ IoT እና USB Type-C® መሳሪያዎች)።
  • የትራንስፖርት ንብርብር ደህንነት (TLS) እጅ መጨባበጥን ጨምሮ ከርቀት አስተናጋጅ ጋር ደህንነቱ የተጠበቀ የሰርጥ ማቋቋሚያ።
  • የፊርማ ማረጋገጫ አገልግሎት (ደህንነቱ የተጠበቀ ቡት እና የጽኑ ትዕዛዝ ማሻሻል)።
  • የአጠቃቀም ቁጥጥር ከአስተማማኝ ቆጣሪዎች ጋር።
  • ማጣመር እና ደህንነቱ የተጠበቀ ሰርጥ ከአስተናጋጅ መተግበሪያ ፕሮሰሰር ጋር።
  • የአካባቢ ወይም የርቀት አስተናጋጅ ፖስታዎችን መጠቅለል እና መፍታት።
  • ላይ-ቺፕ ቁልፍ ጥንድ ትውልድ.

የSTSecureElement Library (STSELib) መግለጫ

ይህ ክፍል የSTSElib መካከለኛ ሶፍትዌር ጥቅል ይዘት እና አጠቃቀሙን ይዘረዝራል።

አጠቃላይ መግለጫ

STSELib መካከለኛውዌር የሚከተሉትን ለማድረግ የተነደፈ የሶፍትዌር ክፍሎች ስብስብ ነው፡-

  • የ STSAFE-A110 እና STSAFE-A120 ደህንነቱ የተጠበቀ ኤለመንት መሳሪያን ከኤም.ሲ.ዩ.
  • በጣም አጠቃላይ የሆኑትን STSAFE-A110 እና STSAFE-A120 አጠቃቀም ጉዳዮችን ተግባራዊ ያድርጉ።
  • የSTSEib middleware ሙሉ ለሙሉ በST ሶፍትዌር ፓኬጆች ውስጥ እንደ መሃከለኛ ዌር አካል ደህንነታቸው የተጠበቁ ንጥረ ነገሮችን ለመጨመር ተዋህዷል።
  • የ STSELib መካከለኛ ዌር ከፍተኛ ደረጃ ያላቸውን የመተግበሪያ ፕሮግራሚንግ በይነገጽ ተግባራትን ለተከተተው የስርዓት ገንቢ ያቀርባል። ይህ ሚድልዌር STMicroelectronics STSAFE-A ደህንነቱ የተጠበቀ አባል ቤተሰብን በመጠቀም መሳሪያን፣ መለዋወጫዎችን እና የፍጆታ ብራንድ ጥበቃን ለማረጋገጥ የሚያስፈልጉትን ትዕዛዞች መገንባት እና ቅደም ተከተል ማስያዝ።
  • ይህ መካከለኛ ዌር በተለያዩ አስተናጋጅ MCU/MPU ስነ-ምህዳር ውስጥ የአንድ ወይም ብዙ STSAFE-A እንከን የለሽ ውህደት ይፈቅዳል።
  • ስለሚደገፉት አይዲኢ ስሪቶች መረጃ ለማግኘት በጥቅሉ ስር አቃፊ ውስጥ የሚገኙትን የመልቀቂያ ማስታወሻዎች ይመልከቱ።

አርክቴክቸር
ከታች በስዕሉ ላይ እንደሚታየው STSELib middleware በሶስት የሶፍትዌር ሞጁሎች የተዋቀረ ነው። እያንዳንዱ ንብርብር ለተከተተው የስርዓት ገንቢ የተለየ የስርዓት ረቂቅ ደረጃ ይሰጣል።

X-CUBE-STSE-Software-Package (2)

ከታች ያለው ምስል በኤስቲኤም32 ኑክሊዮ ቦርድ ላይ በተጫነ X-NUCLEO-SAFEA1 ወይም X-NUCLEO-ESE01A1 የማስፋፊያ ሰሌዳ ላይ የሚሰራውን የSTSELib መካከለኛ ዌር በመደበኛ የ STM32Cube መተግበሪያ ውስጥ ያሳያል።

ምስል 2. X-CUBE-STSE01 የመተግበሪያ እገዳ ንድፍ

X-CUBE-STSE-Software-Package (3)

እጅግ በጣም ጥሩውን የሃርድዌር እና የመድረክ ነጻነትን ለማቅረብ የSTSEib middleware ከ STM32Cube HAL ጋር በቀጥታ የተገናኘ አይደለም፣ ነገር ግን በይነገጽ fileበመተግበሪያ ደረጃ ተተግብሯል

  • የመተግበሪያ ፕሮግራሚንግ በይነገጽ (ኤፒአይ) ንብርብር
    ይህ የሶፍትዌር ንብርብር የስርዓት መተግበሪያ መግቢያ ነጥብ ነው። ከSTMicroelectronics Secure Elements ጋር መስተጋብር የሚፈቅዱ የከፍተኛ ደረጃ ተግባራት ስብስብ ያቀርባል። የኤፒአይ ንብርብር ለተለያዩ አፕሊኬሽኖች እንደ ደህንነቱ የተጠበቀ አካል አስተዳደር፣ ማረጋገጫ፣ የውሂብ ማከማቻ፣ የቁልፍ አስተዳደር አጭር መግለጫ ይሰጣል።
  • የአገልግሎት ንብርብር
    የSERVICE ንብርብር በታለመው ደህንነቱ በተጠበቀው አካል የሚደገፉ ሁሉንም ትዕዛዞች የሚቀርጹ እና ለከፍተኛ የንብርብሮች ኤፒአይ/መተግበሪያ ምላሽን የሚዘግቡ የምርት አገልግሎቶችን ስብስብ ያቀርባል። ይህ ንብርብር በቀጥታ ከመተግበሪያ (ለላቀ ተጠቃሚ) መጠቀም ይቻላል.
  • ኮር ንብርብር
    ለST Secure Element አጠቃላይ ፍቺ እና ከዒላማ ደህንነቱ የተጠበቀ አካል ጋር የመግባቢያ ተግባራትን ይዟል።
    ኮር ንብርብር የመልእክቶቹን ፍሬም ይቆጣጠራል እንዲሁም ከላይ ላሉት ንብርብሮች የመድረክ ረቂቅን ያቀርባል።

የአቃፊ መዋቅር
ከታች ያለው ምስል የ X-CUBE-STSE01 አቃፊ መዋቅርን ያሳያል።

X-CUBE-STSE-Software-Package (4)

የማሳያ ሶፍትዌር

ይህ ክፍል በSTSElib middleware ላይ የተመሰረተ የማሳያ ሶፍትዌርን ያሳያል።

ማረጋገጫ
This demonstration illustrates the command flow where the STSAFE-A110/STSAFE-A120 is mounted on a device that authenticates to a remote host (IoT device case), the local host being used as a pass-through to the remote server.
The scenario where the STSAFE-A110/STSAFE-A120 is mounted on a peripheral that authenticates to a local host, for example ለጨዋታዎች፣ የሞባይል መለዋወጫዎች ወይም ለፍጆታ ዕቃዎች፣ በትክክል አንድ ነው።
ለማሳያ ዓላማዎች፣ የአካባቢ እና የርቀት አስተናጋጆች እዚህ አንድ አይነት መሳሪያ ናቸው።

  1. Extract, parse and verify the STSAFE-A110/ STSAFE-A120’s public certificate stored in the data partition zone 0 of the device in order to get the public key:
    • Read the certificate using the STSELib middleware through the STSAFE-A110/STSAFE-A120’s zone 0.
    • Parse the certificate using the cryptographic library’s parser.
    • Read the CA certificate (available through the code).
    • Parse the CA certificate using the cryptographic library’s parser.
    • Verify the certificate validity using the CA certificate through the cryptographic library.
    • Get the public key from the STSAFE-A110/STSAFE-A120 X.509 certificate.
  2. Generate and verify the signature over a challenge number:
    • Generate a challenge number (random number).
    • Hash the challenge.
    • Fetch a signature over the hashed challenge using the STSAFE-A110/ STSAFE-A120 private key slot 0 through the STSELib middleware.
    • Parse the generated signature using the cryptographic library.
    • Verify the generated signature using the STSAFE-A110/STSAFE-A120’s public key through the cryptographic library.
    • When this is valid, the host knows that the peripheral or IoT is authentic.

ማጣመር (የአስተናጋጅ ቁልፍ አቅርቦት)
ይህ ኮድ example establishes a pairing between an device and the MCU it is connected to. The pairing allows the exchanges between the device and the MCU to be authenticated (that is, signed and verified). The STSAFE-A110 device becomes usable only in combination with the MCU it is paired with.
The pairing consists of the host MCU sending a host MAC key and a host cipher key to the STSAFE-A110 Both keys are stored to the protected NVM of the STSAFE-A110 and should be stored to the flash memory of the STM32 device.
By default, in this example, the host MCU sends well-known keys to the STSAFE-A110 (see command flow below) that are highly recommended to use for demonstration purposes. The code also allows the generation of random keys.
Moreover, the code example generates a local envelope key when the corresponding slot is not already populated in the STSAFE-A110. When the local envelope slot is populated, the STSAFE-A110 device allows the host MCU to wrap/unwrap a local envelope to securely store a key on the host MCU’s side.
Note: The pairing code exampየሚከተሉትን ሁሉ ከመተግበሩ በፊት በተሳካ ሁኔታ መፈፀም አለበት exampሌስ.

የትእዛዝ ፍሰት

  1. Generate the local envelope key in the STSAFE-A110 using the STSELib middleware.
    By default, this command is activated
    ይህ ክዋኔ የሚከሰተው የSTSAFE-A110 የአካባቢ ኤንቨሎፕ ቁልፍ ማስገቢያ አስቀድሞ ካልተሞላ ብቻ ነው።
  2. Define two 128-bit numbers to use as the host MAC key and the host cipher key.
    By default, golden known keys are used. They have the following values:
    • Host MAC key
      0x00, 0x11, 0x22, 0x33, 0x44, 0x55, 0x66, 0x77, 0x88, 0x99, 0xAA, 0xBB, 0xCC, 0xDD, 0xEE, 0xFF
    • Host Cipher Key 0x01, 0x23, 0x45, 0x67, 0x89, 0xAB, 0xCD, 0xEF,0x01, 0x23, 0x45, 0x67, 0x89, 0xAB, 0xCD, 0xEF
  3. Store the host MAC key and the host cipher key to their respective slot in the STSAFE-A110/STSAFE-A120.
  4. Store the host MAC key and the host cipher key to the STM32’s flash memory.

ቁልፍ ማቋቋሚያ (ሲምሜትሪክ ቁልፍ AES-128 CMAC)
ይህ ማሳያ የSTSAFE-A110 መሳሪያ በመሳሪያ ላይ የተጫነበትን ሁኔታ ያሳያል (እንደ አይኦቲ መሳሪያ) ፣ ከርቀት አገልጋይ ጋር የሚገናኝ እና ደህንነቱ የተጠበቀ ቻናል መመስረት አለበት ።
በዚህ የቀድሞample፣ የ STM32 መሣሪያ የርቀት አገልጋይ (የርቀት አስተናጋጅ) እና ከSTSAFE-A110 መሣሪያ ጋር የተገናኘውን የአካባቢ አስተናጋጅ ሚና ይጫወታል።
የዚህ የአጠቃቀም ጉዳይ ግብ በ STSAFE-A110 ውስጥ የማይንቀሳቀስ (ECDH) ወይም ephemeral (ECDHE) ቁልፍ ያለው ሞላላ ከርቭ Diffie-Hellman መርሃግብርን በመጠቀም በአከባቢው አስተናጋጅ እና በሩቅ አገልጋይ መካከል የጋራ ምስጢር እንዴት መመስረት እንደሚቻል ማሳየት ነው።
የተጋራው ሚስጥር ወደ አንድ ወይም ከዚያ በላይ የስራ ቁልፎች (እዚህ ላይ ያልተገለፀ) መሆን አለበት. እነዚህ የስራ ቁልፎች እንደ TLS ባሉ የግንኙነት ፕሮቶኮሎች ውስጥ ጥቅም ላይ ሊውሉ ይችላሉ, ለምሳሌampበአካባቢያዊ አስተናጋጅ እና በርቀት አገልጋይ መካከል የሚለዋወጡትን የመረጃ ምስጢራዊነት ፣ ታማኝነት እና ትክክለኛነት ለመጠበቅ።

የትእዛዝ ፍሰት
ምስል 4. የቁልፍ ማቋቋሚያ ትዕዛዝ ፍሰት የትዕዛዝ ፍሰትን ያሳያል፡-

  • የርቀት አስተናጋጁ የግል እና ይፋዊ ቁልፎች በኮድ exampለ.
  • The local host sends the Generate Keypair command to the STSAFE-A110/STSAFE-A120 to generate the key pair on its ephemeral slot (slot 0xFF).
  • The STSAFE-A110 sends back the public key (which corresponds to slot 0xFF) to the STM32 (representing the remote host).
  • The STM32 computes the remote host’s secret (using the STSAFE device’s public key and the remote host’s private key).
  • The STM32 sends the remote host’s public key to the STSAFE-A110/STSAFE-A120 and asks the STSAFE-A110/STSAFE-A120 to compute the local host’s secret using the API.
  • STSAFE-A110/STSAFE-A120 የአካባቢውን አስተናጋጅ ሚስጥር ወደ STM32 ይልካል።
  • The STM32 compares the two secrets and prints the result. If the secrets are the same, the secret establishment is successful.

X-CUBE-STSE-Software-Package (1)

የአካባቢ ኤንቨሎፖችን መጠቅለል/መጠቅለል

  • This demonstration illustrates the case where the STSAFE-A110/STSAFE-A120 wraps/unwraps the local envelope in order to securely store a secret to any non-volatile memory (NVM).
  • Encryption/decryption keys can be securely stored in that manner to additional memory or within the STSAFE-A110/STSAFE-A120’s user data memory.
  • The wrapping mechanism is used to protect a secret or plain text. The output of wrapping is an envelope encrypted with an AES key wrap algorithm, and that contains the key or plain text to be protected. Command flow
  • The local and remote hosts are the same device here.
  1. Generate random data assimilated to a local envelope.
  2. Wrap the local envelope using the STSELib middleware API.
  3. Store the wrapped envelope.
  4.  Unwrap the wrapped envelope using the STSELIB middleware.
  5.  Compare the unwrapped envelope to the initial local envelope. They should be equal.

የቁልፍ ጥንድ ትውልድ
ይህ ማሳያ STSAFE-A110/STSAFE-A120 መሳሪያ በአካባቢው አስተናጋጅ ላይ የተጫነበትን የትዕዛዝ ፍሰት ያሳያል። የርቀት አስተናጋጅ ይህንን የሀገር ውስጥ አስተናጋጅ በ 1 ኛው ማስገቢያ ላይ የቁልፍ ጥንድ (የግል ቁልፍ እና የህዝብ ቁልፍ) እንዲያመነጭ እና በተፈጠረው የግል ቁልፍ ፈተና (የዘፈቀደ ቁጥር) እንዲፈርም ይጠይቃል።
የርቀት አስተናጋጁ በተፈጠረው የህዝብ ቁልፍ ፊርማውን ማረጋገጥ ይችላል።
ይህ ማሳያ ከሁለት ልዩነቶች ጋር ካለው የማረጋገጫ ማሳያ ጋር ተመሳሳይ ነው።

  • በማረጋገጫ ማሳያው ውስጥ ያሉት የቁልፍ ጥንድ ቀድሞውንም ተፈጥሯል (በመጋዘዣ 0 ላይ)፣ ነገር ግን በዚህ ምሳሌample, we generate the key pair on slot 1. The STSAFE-A110/STSAFE-A120 device can also generate the key pair on slot 0xFF, but only for key establishment purposes.
  • The public key in the Authentication demonstration is extracted from the certificate in zone 0. In this example, the public key is sent back with the STSAFE-A110/STSAFE-A120 response to the Generate Keypair command.

የትእዛዝ ፍሰት
ለማሳያ ዓላማዎች፣ የአካባቢ እና የርቀት አስተናጋጆች እዚህ አንድ አይነት መሳሪያ ናቸው።

  1. The host sends the Generate Keypair command to the STSAFE-A110/STSAFE-A120 which sends back the public key to the host MCU.
  2. The host generates a challenge (48-byte random number) using the Generate Random API. The STSAFE-A110 sends back the generated random number.
  3. The host computes the hash of the generated number using the cryptographic library.
  4. The host asks the STSAFE-A110/STSAFE-A120 to generate a signature of the computed hash using the
    Generate Signature API. The STSAFE-A110/ STSAFE-A120 sends back the generated signature.
  5. The host verifies the generated signature with the public key sent by the STSAFE-A110/ STSAFE-A120 in step 1.
  6. The signature verification result is printed.

መዝገበ ቃላት

ምህጻረ ቃል ትርጉም
AES የላቀ የምስጠራ ደረጃ
ANSI የአሜሪካ ብሔራዊ ደረጃዎች ተቋም
ኤፒአይ የመተግበሪያ ፕሮግራሚንግ በይነገጽ
ቢኤስፒ የቦርድ ድጋፍ ጥቅል
CA የምስክር ወረቀት ባለስልጣን
CC የተለመዱ መስፈርቶች
C-ማክ የትእዛዝ መልእክት ማረጋገጫ ኮድ
ኢ.ሲ.ሲ ኤሊፕቲክ ኩርባ ምስጠራ
ኢ.ሲ.ዲ.ኤች Elliptic curve Diffie–Hellman
ECDHE Elliptic curve Diffie–Hellman – ephemeral
EWARM IAR Embedded Workbench® for Arm®
HAL የሃርድዌር ረቂቅ ንብርብር
አይ/ኦ ግቤት/ውፅዓት
IAR ሲስተምስ® World leader in software tools and services for embedded systems development.
አይዲኢ የተቀናጀ ልማት አካባቢ. የሶፍትዌር አፕሊኬሽን ለኮምፒዩተር ፕሮግራመሮች ለሶፍትዌር ልማት የሚያገለግል።
አይኦቲ የነገሮች በይነመረብ
I²C የተቀናጀ ወረዳ (IIC)
LL ዝቅተኛ-ደረጃ አሽከርካሪዎች
ማክ የመልእክት ማረጋገጫ ኮድ
ኤም.ሲ.ዩ ማይክሮ መቆጣጠሪያ ክፍል
MDK-ARM Keil® microcontroller development kit for Arm®
MPU የማህደረ ትውስታ መከላከያ ክፍል
NVM የማይለዋወጥ ማህደረ ትውስታ
OS ስርዓተ ክወና
SE ደህንነቱ የተጠበቀ አካል
SHA ደህንነቱ የተጠበቀ Hash አልጎሪዝም
SLA የሶፍትዌር ፈቃድ ስምምነት
ST STMicroelectronics
ቲኤልኤስ የመጓጓዣ ንብርብር ደህንነት
ዩኤስቢ ሁለንተናዊ ተከታታይ አውቶቡስ

የክለሳ ታሪክ

ቀን ክለሳ ለውጦች
23-ጁን-2025 1 የመጀመሪያ ልቀት

አስፈላጊ ማስታወቂያ - በጥንቃቄ ያንብቡ

  • STMicroelectronics NV እና ተባባሪዎቹ ("ST") በST ምርቶች እና/ወይም በዚህ ሰነድ ላይ ያለማሳወቂያ በማንኛውም ጊዜ ለውጦችን፣ እርማቶችን፣ ማሻሻያዎችን፣ ማሻሻያዎችን እና ማሻሻያዎችን የማድረግ መብታቸው የተጠበቀ ነው። ገዢዎች ትእዛዝ ከማስገባታቸው በፊት ስለ ST ምርቶች ወቅታዊ መረጃ ማግኘት አለባቸው። የST ምርቶች የሚሸጡት በትእዛዙ እውቅና ጊዜ በ ST የሽያጭ ውሎች እና ሁኔታዎች መሠረት ነው።
  • ገዥዎች የST ምርቶችን የመምረጥ፣ የመምረጥ እና የመጠቀም ሃላፊነት አለባቸው እና ST ለትግበራ እርዳታ ወይም ለገዥዎች ምርቶች ዲዛይን ምንም አይነት ሃላፊነት አይወስድም።
  • ለማንኛውም የአእምሯዊ ንብረት መብት ምንም አይነት ፍቃድ፣ ግልጽ ወይም በተዘዋዋሪ በST አይሰጥም።
  • የ ST ምርቶችን እንደገና መሸጥ በዚህ ውስጥ ከተገለጸው መረጃ የተለየ አቅርቦት በ ST ለእንደዚህ ዓይነቱ ምርት የሚሰጠውን ማንኛውንም ዋስትና ዋጋ ያጣል።
  • ST እና ST አርማ የST የንግድ ምልክቶች ናቸው። ስለ ST የንግድ ምልክቶች ተጨማሪ መረጃ ለማግኘት ይመልከቱ www.st.com/trademarks. ሁሉም ሌሎች የምርት ወይም የአገልግሎት ስሞች የየባለቤቶቻቸው ንብረት ናቸው።
  • በዚህ ሰነድ ውስጥ ያለው መረጃ ከዚህ ቀደም በማንኛውም የዚህ ሰነድ ቀደምት ስሪቶች ውስጥ የቀረበውን መረጃ ይተካዋል እና ይተካል።
  • © 2025 STMicroelectronics - ሁሉም መብቶች የተጠበቁ ናቸው

ሰነዶች / መርጃዎች

ST X-CUBE-STSE01 ሶፍትዌር ጥቅል [pdf] የተጠቃሚ መመሪያ
X-CUBE-STSE01 የሶፍትዌር ጥቅል ፣ የሶፍትዌር ጥቅል ፣ ሶፍትዌር

ዋቢዎች

አስተያየት ይስጡ

የኢሜል አድራሻዎ አይታተምም። አስፈላጊ መስኮች ምልክት ተደርጎባቸዋል *