summaryrefslogtreecommitdiff
path: root/cmd/goaes/commands
diff options
context:
space:
mode:
Diffstat (limited to 'cmd/goaes/commands')
-rw-r--r--cmd/goaes/commands/generate.go21
1 files changed, 21 insertions, 0 deletions
diff --git a/cmd/goaes/commands/generate.go b/cmd/goaes/commands/generate.go
new file mode 100644
index 0000000..2ce2400
--- /dev/null
+++ b/cmd/goaes/commands/generate.go
@@ -0,0 +1,21 @@
+package commands
+
+import (
+ "context"
+ "encoding/base64"
+ "fmt"
+
+ "github.com/nerdsec/goaes/internal"
+ "github.com/urfave/cli/v3"
+)
+
+func Generate(ctx context.Context, cmd *cli.Command) error {
+ key, err := internal.NewDEK()
+ if err != nil {
+ return err
+ }
+
+ fmt.Println(base64.StdEncoding.EncodeToString(key))
+
+ return nil
+}