started to implement the key generator
This commit is contained in:
1 parent
ad4510711e
commit
776c73b91c
7 files changed
+233
-2
No files matched your search
@@ -2,8 +2,33 @@ package main
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"github.com/codegangsta/cli"
|
||||
"os"
|
||||
)
|
||||
|
||||
const VERSION = "0.0.1"
|
||||
|
||||
var createKeyCommand = cli.Command{
|
||||
Name: "createkey",
|
||||
Usage: "create a pair of public/private key",
|
||||
Flags: []cli.Flag{
|
||||
cli.IntFlag{Name: "size, s", Value: 2048, Usage: "key size in bits"},
|
||||
cli.StringFlag{Name: "password, p", Value: "", Usage: "password to access the private key"},
|
||||
},
|
||||
Action: func(c *cli.Context) {
|
||||
keyGenerator := new(KeyGenerator)
|
||||
keyGenerator.CreateNewKey(c.Int("size"), c.String("password"))
|
||||
},
|
||||
}
|
||||
|
||||
func main() {
|
||||
fmt.Println("hello world")
|
||||
app := cli.NewApp()
|
||||
app.Name = "ecrypto"
|
||||
app.Usage = "encrypt files"
|
||||
app.Commands = []cli.Command{
|
||||
createKeyCommand,
|
||||
}
|
||||
|
||||
fmt.Println(os.Args)
|
||||
app.Run(os.Args)
|
||||
}
|
||||
Reference in new issue
Block a user