Skip to main content
CMura.2
Associate II
April 26, 2021
Solved

Please, where can I find a "key_pair_generation" example code for the Discovery Kit B-L4S5_IOT01A? (STSAFE)

  • April 26, 2021
  • 1 reply
  • 563 views

I tried porting the example code has been done for the Nucleo board to the B-L4S5_IOT01A but I get STSAFEA_COMMUNICATION_ERROR as result. SEE BELOW

Key pair generation demonstration:

 

 1. Generate key pair through STSAFE-A's private key slot 1

 

 => Use StSafeA_GenerateKeyPair API

 

 StatusCode = STSAFEA_INVALID_PARAMETER 48.

 

 /* Check null pointers */

 

 IS_STSAFEA_HANDLER_VALID_PTR(pStSafeA) 1.

 

 IS_STSAFEA_CONDITIONAL_LVBUFFER_VALID_PTR(pOutPubX) 1.

 

 IS_STSAFEA_CONDITIONAL_LVBUFFER_VALID_PTR(pOutPubY) 1.

 

 pOutPointReprensentationId 48.

 

 /* Check parameters */

 

 **Inside StSafeA_TransmitCommand **

 

 StatusCode StSafeA_TransmitCommand 0.

 

 **Inside StSafeA_Transmit **

 

 StatusCode StSafeA_Transmit 0.

 

 **Inside StSafeA_TransmitCommand **

 

 StatusCode StSafeA_TransmitCommand 0.

 

 **Inside StSafeA_Transmit **

 

 StatusCode StSafeA_Transmit 0.

 

 /* Transmit */

 

 StatusCode = STSAFEA_INVALID_PARAMETER 0.

 

 /* after StSafeA_ReceiveResponse */

 

 StatusCode StSafeA_ReceiveResponse 1.

 

 StatusCode StSafeA_GenerateKeyPair 1.

 

 2. Signature verification result (0 means success): 1

 

**key_pair_generation(&stsafea_handle) != 0 **

 

STSAFEA_COMMUNICATION_ERROR

    This topic has been closed for replies.
    Best answer by Imen.D

    Hello @CMura.2​ and welcome to the STM32 Community =)

    You can download the software package for STSAFE-A from ST website: X-CUBE-SAFEA1.

    When your question is answered, please close this topic by choosing "Select as Best". This will help other users find that answer faster.

    Imen

    1 reply

    Imen.DBest answer
    Technical Moderator
    April 26, 2021

    Hello @CMura.2​ and welcome to the STM32 Community =)

    You can download the software package for STSAFE-A from ST website: X-CUBE-SAFEA1.

    When your question is answered, please close this topic by choosing "Select as Best". This will help other users find that answer faster.

    Imen

    In order to give better visibility on the answered topics, please click on 'Best answer' on the reply which solved your issue or answered your question. Thanks