Skip to content

Commit

Permalink
Merge pull request #47 from anhu/maxq_init
Browse files Browse the repository at this point in the history
Add initialization script for maxq10xx.
  • Loading branch information
SparkiDev authored Feb 7, 2025
2 parents b9779c7 + 82916f7 commit a221997
Show file tree
Hide file tree
Showing 2 changed files with 28 additions and 0 deletions.
7 changes: 7 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,13 @@ Sets the private key's label against the public key when generating key pairs.
Support has been added to use the maxq10xx hardware for cryptographic operations
and storage of certificate.

Before usage:
1. Make sure the maxq10xx-sdk is installed and it has installed the proper
header files into the source code for wolfPKCS11.
2. Edit `examples/maxq10xx_init.sh` to ensure it is pointing to the correct
location.
3. Execute `examples/maxq10xx_init.sh` to ensure it is properly initialized.

NOTE: In the code, we have embedded a test key. This must be changed for
production environments!! Please contact Analog Devices to learn how to
obtain and use a production key.
Expand Down
21 changes: 21 additions & 0 deletions examples/maxq10xx_init.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
#!/bin/sh

# Please set the correct path
MAXQ_SDK=/path/to/maxq10xx-sdk

# Nothing below here needs to be changed.

MAXQ_TOOLBOX=${MAXQ_SDK}/maxq10xx-toolbox/bin

# Zeroize the onboard NV Memory.
${MAXQ_TOOLBOX}/maxq10xx_admin-auth
${MAXQ_TOOLBOX}/maxq10xx_set-state 4
${MAXQ_TOOLBOX}/maxq10xx_set-state 3
sleep 2
${MAXQ_TOOLBOX}/maxq10xx_get-status

# Setup Object ID 1004 to have an ECDSA secp256r1 keypair.
${MAXQ_TOOLBOX}/maxq10xx_admin-auth
${MAXQ_TOOLBOX}/maxq10xx_create-key --key-pair 1004 192 x=rwdgx:x=rwdgx:x=rwdgx
${MAXQ_TOOLBOX}/maxq10xx_key-gen 1004 --ecc SECP256R1 DATASIGNATURE ECDSA-SHA256 NONE NONE

0 comments on commit a221997

Please sign in to comment.