Skip to content

Commit

Permalink
Use Curve constants from GoSDK
Browse files Browse the repository at this point in the history
  • Loading branch information
robin-turnkey committed Aug 13, 2024
1 parent 1545229 commit 44278f2
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/cmd/turnkey/pkg/generate.go
Original file line number Diff line number Diff line change
Expand Up @@ -57,17 +57,17 @@ var apiKeyCmd = &cobra.Command{
switch curveType {
default:
OutputError(fmt.Errorf("invalid curve type: %s; supported types are p256, secp256k1, and ed25519", curveType))
case "p256":
case string(apikey.CurveP256):
apiKey, err = apikey.New(Organization, apikey.WithScheme(apikey.SchemeP256))
if err != nil {
OutputError(eris.Wrap(err, "failed to create API keypair"))
}
case "secp256k1":
case string(apikey.CurveSecp256k1):
apiKey, err = apikey.New(Organization, apikey.WithScheme(apikey.SchemeSECP256K1))
if err != nil {
OutputError(eris.Wrap(err, "failed to create API keypair"))
}
case "ed25519":
case string(apikey.CurveEd25519):
apiKey, err = apikey.New(Organization, apikey.WithScheme(apikey.SchemeED25519))
if err != nil {
OutputError(eris.Wrap(err, "failed to create API keypair"))
Expand Down

0 comments on commit 44278f2

Please sign in to comment.