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

Added keyset-file flag tp specify file path and name #1223

Merged
merged 2 commits into from Feb 25, 2019
Merged
Changes from 1 commit
Commits
File filter...
Filter file types
Jump to…
Jump to file or symbol
Failed to load files and symbols.
+9 −1
Diff settings

Always

Just for now

Copy path View file
@@ -44,6 +44,9 @@ development.
keytransparency-client authorized-keys create-keyset --password=${PASSWORD}
keytransparency-client authorized-keys list-keyset --password=${PASSWORD}
```
The `create-keyset` will create a `.keyset` file in the user's working directory.
This conversation was marked as resolved by Zyqsempai

This comment has been minimized.

Copy link
@gdbelvin

gdbelvin Feb 25, 2019

Collaborator
Suggested change
The `create-keyset` will create a `.keyset` file in the user's working directory.
The `create-keyset` command will create a `.keyset` file in the user's working directory.
To specify custom directory use `--keyset-file` or `--kf` shortcut.

NB A default for the Key Transparency server URL is being used here. The default value is "35.202.56.9:443". The flag `--kt-url` may be used to specify the URL of Key Transparency server explicitly.


@@ -55,6 +55,7 @@ func init() {
hammerCmd.Flags().IntVar(&maxWorkers, "workers", 1000, "Number of parallel workers. Best when workers = QPS * timeout")
hammerCmd.Flags().IntVar(&maxOperations, "operations", 10000, "Number of operations")
hammerCmd.Flags().StringVarP(&masterPassword, "password", "p", "", "The master key to the local keyset")
hammerCmd.Flags().StringVarP(&keysetFile, "keyset-file", "kf", defaultKeysetFile, "Keyset file name and path")
}

// hammerCmd represents the post command
@@ -27,11 +27,12 @@ import (
tinkpb "github.com/google/tink/proto/tink_go_proto"
)

const keysetFile = ".keyset"
const defaultKeysetFile = ".keyset"

var (
keyType string
masterPassword string
keysetFile string
)

// keysCmd represents the authorized-keys command.
@@ -116,4 +117,6 @@ func init() {
keysCmd.PersistentFlags().StringVarP(&masterPassword, "password", "p", "", "The master key to the local keyset")

createCmd.Flags().StringVar(&keyType, "key-type", "P256", "Type of keys to generate: [P256, P384, P521]")
createCmd.Flags().StringVarP(&keysetFile, "keyset-file", "kf", defaultKeysetFile, "Keyset file name and path")
listCmd.Flags().StringVarP(&keysetFile, "keyset-file", "kf", defaultKeysetFile, "Keyset file name and path")
}
@@ -121,6 +121,7 @@ func init() {

postCmd.PersistentFlags().StringVarP(&masterPassword, "password", "p", "", "The master key to the local keyset")
postCmd.PersistentFlags().StringP("secret", "s", "", "Path to client secret json")
postCmd.Flags().StringVarP(&keysetFile, "keyset-file", "kf", defaultKeysetFile, "Keyset file name and path")
if err := viper.BindPFlag("client-secret", postCmd.PersistentFlags().Lookup("secret")); err != nil {
log.Fatalf("%v", err)
}
ProTip! Use n and p to navigate between commits in a pull request.
You can’t perform that action at this time.