Skip to content

Commit

Permalink
feat: add aes generation test
Browse files Browse the repository at this point in the history
  • Loading branch information
nponsard committed Sep 18, 2023
1 parent eb381b0 commit 0994cba
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 1 deletion.
2 changes: 1 addition & 1 deletion p11nethsm.conf
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ slots:
username: "admin"
password: "Administrator"
instances:
- url: "https://localhost:8443/api/v1"
- url: "https://localhost:8444/api/v1"
danger_insecure_cert: true
# sha256_fingerprints:
# - "31:92:8E:A4:5E:16:5C:A7:33:44:E8:E9:8E:64:C4:AE:7B:2A:57:E5:77:43:49:F3:69:C9:8F:C4:2F:3A:3B:6E"
Expand Down
16 changes: 16 additions & 0 deletions tools/tests/generate_aes_id.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
#!/bin/sh -x

set -e

KEYID=testAESkey

HEXID=$(echo -n ${KEYID} | xxd -ps)

curl -k -u admin:Administrator -v -X DELETE \
https://localhost:8443/api/v1/keys/$KEYID

pkcs11-tool --module target/debug/libnethsm_pkcs11.so --keygen --key-type AES:128 \
--login --login-type so --so-pin Administrator --id $HEXID

curl -k --fail-with-body -u operator:opPassphrase -v -X GET \
https://localhost:8443/api/v1/keys/$KEYID

0 comments on commit 0994cba

Please sign in to comment.