Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix demos to work with new wolfHSM API #17

Merged
merged 18 commits into from
Nov 5, 2024
Merged
Show file tree
Hide file tree
Changes from 5 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
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
.DS_Store
Build/
demo/certs/*.pem

Binary file added demo/certs/alice-ecc256-key.der
Binary file not shown.
Binary file added demo/certs/bob-ecc256-key.der
Binary file not shown.
2 changes: 0 additions & 2 deletions demo/certs/curve25519-private-alice.raw

This file was deleted.

1 change: 0 additions & 1 deletion demo/certs/curve25519-private-bob.raw

This file was deleted.

2 changes: 0 additions & 2 deletions demo/certs/curve25519-public-alice.raw

This file was deleted.

1 change: 0 additions & 1 deletion demo/certs/curve25519-public-bob.raw

This file was deleted.

Binary file removed demo/certs/ecc-private-alice.raw
Binary file not shown.
1 change: 0 additions & 1 deletion demo/certs/ecc-private-bob.raw

This file was deleted.

1 change: 0 additions & 1 deletion demo/certs/ecc-public-alice.raw

This file was deleted.

1 change: 0 additions & 1 deletion demo/certs/ecc-public-bob.raw

This file was deleted.

18 changes: 18 additions & 0 deletions demo/certs/genKeys.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
#!/bin/bash

# ECC Keys
openssl genpkey -algorithm EC -pkeyopt ec_paramgen_curve:prime256v1 -out alice-ecc256-key.pem
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Grumble. Hate relying on openssl. Maybe we should leave some pregenerated keys in PEM format in the repo as well in case they don't have openssl available? No change recommended at this point. Just a thought.

openssl genpkey -algorithm EC -pkeyopt ec_paramgen_curve:prime256v1 -out bob-ecc256-key.pem
openssl ec -in alice-ecc256-key.pem -outform DER -out alice-ecc256-key.der
openssl ec -in bob-ecc256-key.pem -outform DER -out bob-ecc256-key.der

# RSA Key
openssl genpkey -algorithm RSA -pkeyopt rsa_keygen_bits:2048 -out rsa-2048-key.pem
openssl rsa -in rsa-2048-key.pem -outform DER -out rsa-2048-key.der

# TODO: Curve25519 Keys
# Either need to modify examples to split out public/private operations, or modify wolfHSM to be able to recove public keys on deserialization of private only.
#openssl genpkey -algorithm X25519 -out alice-curve25519-key.pem
#openssl genpkey -algorithm X25519 -out bob-curve25519-key.pem
#openssl pkey -in alice-curve25519-key.pem -outform DER -out alice-curve25519-key.der
#openssl pkey -in bob-curve25519-key.pem -outform DER -out bob-curve25519-key.der
Binary file added demo/certs/rsa-2048-key.der
Binary file not shown.
Loading