Skip to content

Commit

Permalink
rename path flag names
Browse files Browse the repository at this point in the history
  • Loading branch information
Olivia Thet committed Mar 12, 2024
1 parent 8e31732 commit 5668329
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions src/cmd/turnkey/pkg/decrypt.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ package pkg
import (
"encoding/json"

"github.com/rotisserie/eris"
"github.com/spf13/cobra"
"github.com/tkhq/go-sdk/pkg/enclave_encrypt"
)
Expand All @@ -11,8 +12,8 @@ import (
var exportBundlePath string

func init() {
decryptCmd.Flags().StringVar(&exportBundlePath, "export-bundle-path", "/export_bundle.txt", "filepath to write the export bundle to.")
decryptCmd.Flags().StringVar(&plaintextPath, "plaintext-path", "", "filepath to write the plaintext from that will be decrypted.")
decryptCmd.Flags().StringVar(&exportBundlePath, "export-bundle-input", "", "filepath to write the export bundle to.")
decryptCmd.Flags().StringVar(&plaintextPath, "plaintext-output", "", "optional filepath to write the plaintext from that will be decrypted.")

rootCmd.AddCommand(decryptCmd)
}
Expand All @@ -21,6 +22,11 @@ var decryptCmd = &cobra.Command{
Use: "decrypt",
Short: "Decrypt a ciphertext",
Long: `Decrypt a ciphertext from a bundle exported from a Turnkey secure enclave.`,
PreRun: func(cmd *cobra.Command, args []string) {
if encryptedBundlePath == "" {
OutputError(eris.New("--encrypted-bundle-input must be specified"))
}
},
Run: func(cmd *cobra.Command, args []string) {
// read from export bundle path
exportBundle, err := readFile(exportBundlePath)
Expand Down

0 comments on commit 5668329

Please sign in to comment.