Skip to content

Commit 079922a

Browse files
committed
misc: Update readme.
1 parent f6f69f4 commit 079922a

File tree

1 file changed

+14
-6
lines changed

1 file changed

+14
-6
lines changed

README.md

+14-6
Original file line numberDiff line numberDiff line change
@@ -111,17 +111,25 @@ python examples/example.py
111111
```
112112

113113
## Testing on MicroPython
114-
MicroPython currently does Not support secure elements. The username and password can be used, or the key and cert files must be stored in DER format on the filesystem. To test the client on MicroPython, first convert the key and certificate to DER, using the following commands, then copy the files to the internal storage.
115-
116-
#### Convert key and certificate to `.DER`
114+
MicroPython supports both modes of authentication: basic mode, using a username and password, and mTLS with the key and certificate stored on the filesystem or a secure element (for provisioned boards). To use key and certificate files stored on the filesystem, they must first be converted to DER format. The following commands can be used to convert from PEM to DER:
117115
```bash
118116
openssl ec -in key.pem -out key.der -outform DER
119117
openssl x509 -in cert.pem -out cert.der -outform DER
120118
```
121119

122-
#### Run the MicroPython example script
123-
* Set `KEY_PATH`, `CERT_PATH`, to key and certificate DER paths respectively.
124-
* run `examples/micropython.py`
120+
In this case `KEY_PATH`, `CERT_PATH`, can be set to the key and certificate DER paths, respectively:
121+
```Python
122+
KEY_PATH = "path/to/key.der"
123+
CERT_PATH = "path/to/cert.der"
124+
```
125+
126+
Alternatively, if the key and certificate are stored on the SE, their URIs can be specified in the following format:
127+
```Python
128+
KEY_PATH = "se05x:token=0x00000064"
129+
CERT_PATH = "se05x:token=0x00000065"
130+
```
131+
132+
With the key and certificate set, the example can be run with the following command `examples/micropython_advanced.py`
125133

126134
## Useful links
127135

0 commit comments

Comments
 (0)