feat: basalt 0.0.1

This commit is contained in:
FernandoJVideira committed 2026-01-27 17:33:14 +00:00
1 parent 487d1d324d
commit 5e31fc2f23
22 files changed
+1364 -1

No files matched your search

+37
View File
@@ -0,0 +1,37 @@
package cmd
import (
"fmt"
"github.com/spf13/cobra"
)
func init() {
newCmd.AddCommand(keyCmd)
}
var size int
var defaultSize = 32
var keyCmd = &cobra.Command{
Use: "key [size]",
Short: "Generate a new cryptographic key",
Long: `Generate a new cryptographic key for use in Keystone projects.`,
Run: func(cmd *cobra.Command, args []string) {
var keyLength int
if cmd.Flags().Lookup("size").Changed {
keyLength = size
} else {
keyLength = defaultSize
}
if keyLength <= 32 {
fmt.Println("Warning: It is recommended to use a key size greater than 32 for better security.")
fmt.Println("Generating a key of default size:", defaultSize)
keyLength = defaultSize
}
key := randomString(keyLength)
println("Generated Key:", key)
},
}