Page 1 of 1

"How to Generate PKI Files" Query

Posted: Wed Jan 11, 2023 10:33 am
by ShahinHaque
Hello,

Using the espressif link : https://docs.espressif.com/projects/esp ... ompilation

Am I correct in saying if I converted https://github.com/espressif/esp-at/tre ... lient_cert using

Code: Select all

python AtPKI.py generate_bin -b ./client_cert.bin  cert ../components/customized_partitions/raw_data/client_cert/client_cert_00.crt cert ../components/customized_partitions/raw_data/client_cert/client_cert_01.crt
I would achieve the same results as the site. ie

type (1 bytes) : certificate: 0x02

ID (1 bytes) : 0x01

content len (2 bytes) : 0x8C 0x04

and so 0x02 0x01 0x8C 0x04 should appear in my file.

Can someone else do this with the files on GitHub and let me know if they match the tutorial?

My results are:

Code: Select all

ññ H	    -----BEGIN CERTIFICATE-----
MIIDLTCCAhWgAwIBAgIJAN6LrsW0Qt2FMA0GCSqGSIb3DQEBCwUAMDcxCzAJBgNV
BAYTAkMxMQ8wDQYDVQQKDAZFU1AgQzExFzAVBgNVBAMMDkVTUCBSb290IENBIEMx
MB4XDTE5MDYyMTA4MDAyM1oXDTI5MDYxODA4MDAyM1owNzELMAkGA1UEBhMCQzIx
DzANBgNVBAoMBkVTUCBDMjEXMBUGA1UEAwwORVNQIFJvb3QgQ0EgQzIwggEiMA0G
CSqGSIb3DQEBAQUAA4IBDwAwggEKAoIBAQC02DXgCw0gSDShaHLDlanRppKjIoJ0
JW/+gDkg8j1PCNm5WxkAx3BItBN6hnJwwlQ4DMWCZXe+EDDYz8cKLC5g2TetrpxJ
aSQ4JyPqxU5uiym26C+nTL9/d40Nom//3+fDjA0+7bdUkffcKdhZV7MsxKF2dBb9
eKFJeIjc8q0Q0LqKr3xnKOeGN2Xt80oJTv8XIEfko/mfkINr83AhH/WPkSg2kJS/
C2Xyl6Q22ew01vZv0Am5ocl3+ju2Dyv/nbQl2Vru1K9TD+b8fDacmqZco4oeQBvf
EhyW7FOhUf2yLgpUdEEGyAMZ9JgoTJih1dnr9CLHkt/XMCn03HOcfpPlAgMBAAGj
PDA6M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B8Sa
+CBRkw28OLsvy9pe68gzQB/ByzYn9YA9CbPhAcPIFzZGGcYzYpJ4+iaBAgMBAAGj
PDA6MAwGA1UdEwQFMAMBAf8wCwYDVR0PBAQDAgGmMB0GA1UdDgQWBBT+jizf84cm
xiP9JWrdTMqu/s1fhjANBgkqhkiG9w0BAQsFAAOCAQEAUaJYorLzwlU++noeCbn7
dDEgHO/F4bqbIaxQBZt//tUxdk5PWaaS9KwqYckAC63PWX4+4z1yJjS7uHMgpVJ3
4zVeWWAR6I4vKxYNDWRLSqsnmiIp+9SUxCZhdvgPwaoFT3W8ytOLhpyvtujW21uk
InB4oF94ADGzZeW1rKNammUYxENtW5ail+ZopNGEw8DjRfrWwi+VT/TgxWWBShlO
IZoo+Ob+lq/hF+9xEAhAxeP9qcO8FXnzhKkvhxJK5ek0ZCMeCcZ8p0sSmj4RYaOf
9CApVRkOYcysI2Cwe3H2d5+RMx4iIgEbOrzlW2Rssmw7wgbyka/8co2cM7Nn4+84
HA==
-----END CERTIFICATE-----
Before the first certificate there is:

Code: Select all

ññ H	    
 
which equals in hex

Code: Select all

F1 F1 20 48 09 20 20 20 A0
Before the second certificate there is:

Code: Select all

  
 
which equals in hex

Code: Select all

02 01 A0 04
Note: some special characters may not show up on here so I have listed the hex value









Thank you,
Shahin Haque

Re: "How to Generate PKI Files" Query

Posted: Fri Mar 24, 2023 11:47 am
by esp-at
you are right if you use the previous esp-at version (not the master branch).

The latest esp-at version (master branch) branch has adopted a new nvs storage method, replacing the previous partition storage method. I will start writing a detailed document and script in April to introduce the new configuration generation method (certificates, private keys, Wi-Fi configuration, Bluetooth configuration, system configuration).

~