public key create failed

I create the private.key by nrfutil.exe keys generate C:\key\pricate.key.

Then enter nrfutil keys display --key pk --format code C:\key\private.key --out_file C:\key\public_key.c.

The error happened and output as follow:

Parents
  • Hello,

    Can you either try using an older version of Python (It is working with Python 3.8.0 on my end). Alternatively, you can use the new nrfutil, which you can find here. (no longer a python pip download). It is now a standalone module, which doesn't depend on specific python versions in order to work.

    Just note that after uninstalling the python based nrfutil, and installing the new version, you need to use the command:

    nrfutil install nrf5sdk-tools

    After that, nrfutil should work like before, and you don't need to use nrfutil nrf5sdk-tools ... in your commands. "nrfutil keys generate private.key", and "nrfutil keys display --key pk private.key --format code --out_file public_key.c" should work.

    Best regards,

    Edvin

  • Hi,

    I download the new nrfutil that no longer a python pip download.It is a exe file in windows.If I can use cmd in the folder to use directly without install?Because it seem nothing happen when I try to run it.

  • You can, but you need to make sure that you place the nrfutil.exe in a folder that is in your computer's environment path. In case you are not familiar with this, this means that you need to put it in a folder (that can be wherever). Then note the path to this folder, and open your system settings:

    Double click "Path" under system variables:

    And add a line at the end with the path to the folder where you placed your nrfutil.exe. Click Ok/yes everywhere as you close, and close all your terminal windows. After this, open a new terminal window, and you should be able to call nrfutil from anywhere.

    Best regards,

    Edvin

  • Hi,

    When I try to run nrfutil by command line,the output as follow:

    It seem need to download something and I should change the variable(s).

    I don't know anything about it.

    Besides,the network that I using is in china,if I need to over the internet wall.

Reply Children
  • Oh, I was not aware that it was dependent on Github. 

    I assume you have internet connectivity on the computer where you are running this? 

    It seems you need access to github in order to run this, but when you have set it up, you can make it run in "offline mode" by using the command:

    nrfutil prepare-offline <path to offline sources>

    So after running this, you are no longer dependent on github access. The path you can choose yourself. It is where it will store the datapacks needed to run in offline mode. 

    I will ask our nrfutil team whether there is a way around this initial download from github. In the meantime, if you just need to generate some keys, I suggest you go back to the old nrfutil (pip install nrfutil). Remember to remove the new version from your path if you use the old one. 

    And in order to use the old nrfutil, you need to roll back your python version a few versions. As mentioned in the initial reply, version 3.8.0 should work.

    Best regards,

    Edvin

  • Hi,

    I want to know if the path to offline sources is the path of nrfutil.exe?Or it is point to other component of github?

    I am prefer to use the new version.Because the older version need python.There are some version of python in my computer and it is trouble to manager multiple version.

  • I can understand that. I just meant until you get the new nrfutil up and running. 

    Chaoyue Ying said:
    I want to know if the path to offline sources is the path of nrfutil.exe?

    No, when you call the prepare-offline command, it will save some data in the path that you select. 

    Before calling it, this folder had only nrfutil.exe:

    But after it was called, then nrfutil would download these folders.

  • I don't sure if I understand correctly.

    I tried it but still happen the error as follow:

  • It looks like you are blocked by some firewall, and you are not able to reach github. I am sorry, but I don't have any other workarounds than to default back to the old nrfutil for now, unless you have some way to gain access to github.com and githubusercontent.com.

    I could download the file for you and upload it here, but then nrfutil wouldn't have a way to use that file. It is not possible to give it as a manual input at this point. 

    Best regards,

    Edvin

Related