Skip to content

Commit

Permalink
scripts: west_commands: ncs-provision locked key
Browse files Browse the repository at this point in the history
adds ability to upload key as locked.

Signed-off-by: Mateusz Michalek <[email protected]>
  • Loading branch information
michalek-no committed Dec 9, 2024
1 parent 6dcaf8c commit eb606bb
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion scripts/west_commands/ncs-provision.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@
from west.commands import WestCommand

nrf54l15_key_slots = [226, 228, 230]
nrf54l15_key_policies = {"revokable": "REVOKED",
"lock": "LOCKED"}


class NcsProvision(WestCommand):
Expand All @@ -34,6 +36,8 @@ def do_add_parser(self, parser_adder):
"-k", "--key", type=Path, action='append', dest="keys",
help="Input .pem file with ED25519 private key"
)
upload_parser.add_argument("-p", "--policy", type=str, help="Keys policy",
choices=["revokable", "lock"], default="revokable")
upload_parser.add_argument("-s", "--soc", type=str, help="SoC",
choices=["nrf54l15"], required=True)
upload_parser.add_argument("--dev-id", help="Device serial number")
Expand All @@ -55,7 +59,7 @@ def do_run(self, args, unknown_args):
"nrfprovision",
"provision",
"-r",
"REVOKED",
nrf54l15_key_policies[args.policy],
"-v",
pub_key.public_bytes_raw().hex(),
"-m",
Expand Down

0 comments on commit eb606bb

Please sign in to comment.