Skip to content
Merged
Show file tree
Hide file tree
Changes from 10 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
92 changes: 92 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,92 @@
# EditorConfig: https://editorconfig.org/

# top-most EditorConfig file
root = true

# All (Defaults)
[*]
charset = utf-8
end_of_line = lf
insert_final_newline = true
trim_trailing_whitespace = true
max_line_length = 100

# Assembly
[*.S]
indent_style = tab
indent_size = 8

# C
[*.{c,h}]
indent_style = tab
indent_size = 8

# C++
[*.{cpp,hpp}]
indent_style = tab
indent_size = 8

# Linker Script
[*.ld]
indent_style = tab
indent_size = 8

# Python
[*.py]
indent_style = space
indent_size = 4

# Perl
[*.pl]
indent_style = tab
indent_size = 8

# reStructuredText
[*.rst]
indent_style = space
indent_size = 3

# YAML
[*.{yml,yaml}]
indent_style = space
indent_size = 2

# Shell Script
[*.sh]
indent_style = space
indent_size = 4

# Windows Command Script
[*.cmd]
end_of_line = crlf
indent_style = tab
indent_size = 8

# Valgrind Suppression File
[*.supp]
indent_style = space
indent_size = 3

# CMake
[{CMakeLists.txt,*.cmake}]
indent_style = space
indent_size = 2

# Makefile
[Makefile]
indent_style = tab
indent_size = 8

# Device tree
[*.{dts,dtsi,overlay}]
indent_style = tab
indent_size = 8

# Git commit messages
[COMMIT_EDITMSG]
max_line_length = 75

# Kconfig
[Kconfig*]
indent_style = tab
indent_size = 8
2 changes: 1 addition & 1 deletion .github/workflows/python.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: ['3.9', '3.10', '3.11', '3.12', '3.13']
python-version: ['3.10', '3.11', '3.12', '3.13']

steps:
- uses: actions/checkout@v4
Expand Down
45 changes: 39 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,24 +15,32 @@ For the device to respond to AT commands, the firmware on the device must have a
## Command Line Interface

```
usage: nrfcredstore [-h] [--baudrate BAUDRATE] [--timeout TIMEOUT] dev {list,write,delete,generate} ...
usage: nrfcredstore [-h] [--baudrate BAUDRATE] [--timeout TIMEOUT] [--debug] [--cmd-type {at,shell,auto}]
dev {list,write,delete,deleteall,imei,attoken,generate} ...

Manage certificates stored in a cellular modem.

positional arguments:
dev Serial device used to communicate with the modem.
dev Device used to communicate with the modem. For interactive selection of serial port, use "auto". For RTT, use "rtt". If given a SEGGER
serial number, it is assumed to be an RTT device.

options:
-h, --help show this help message and exit
--baudrate BAUDRATE Serial baudrate
--timeout TIMEOUT Serial communication timeout in seconds
--debug Enable debug logging
--cmd-type {at,shell,auto}
Command type to use. "at" for AT commands, "shell" for shell commands, "auto" to detect automatically.

subcommands:
{list,write,delete,generate}
{list,write,delete,deleteall,imei,attoken,generate}
Certificate related commands
list List all keys stored in the modem
write Write key/cert to a secure tag
delete Delete value from a secure tag
deleteall Delete all keys in a secure tag
imei Get IMEI from the modem
attoken Get attestation token of the modem
generate Generate private key
```

Expand All @@ -56,7 +64,7 @@ Secure tag Key type SHA

### write subcommand

Write key/cert to a secure tag. KEY_TYPE must be either ROOT_CA_CERT, CLIENT_CERT, CLIENT_KEY, or PSK.
Write key/cert to a security tag. KEY_TYPE must be either ROOT_CA_CERT, CLIENT_CERT, CLIENT_KEY, or PSK.

```
usage: nrfcredstore [--baudrate BAUDRATE] [--timeout TIMEOUT] dev write SECURE_TAG KEY_TYPE FILENAME
Expand All @@ -68,7 +76,7 @@ usage: nrfcredstore [--baudrate BAUDRATE] [--timeout TIMEOUT] dev write SECURE_T

### delete subcommand

Delete value from a secure tag.
Delete value from a security tag.

```
usage: nrfcredstore [--baudrate BAUDRATE] [--timeout TIMEOUT] dev delete SECURE_TAG KEY_TYPE
Expand All @@ -78,6 +86,31 @@ usage: nrfcredstore [--baudrate BAUDRATE] [--timeout TIMEOUT] dev delete SECURE_

$ nrfcredstore /dev/tty.usbmodem0009600000001 delete 123 ROOT_CA_CERT

### deletall subcommand

Delete all writable security tags.

```
usage: nrfcredstore [--baudrate BAUDRATE] [--timeout TIMEOUT] dev deleteall
```

### imei subcommand

Read IMEI from modem.

```
usage: nrfcredstore [--baudrate BAUDRATE] [--timeout TIMEOUT] dev imei
```

### attoken subcommand

Read Attestation Token from modem.

```
usage: nrfcredstore [--baudrate BAUDRATE] [--timeout TIMEOUT] dev attoken
```


### generate subcommand

> [!IMPORTANT]
Expand Down Expand Up @@ -114,4 +147,4 @@ Running the tests depends on a [development installation](#development-installat

Check coverage

poetry run pytest --cov=. tests
poetry run pytest --cov=. tests
Loading