Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var KeyfileCmd = &cobra.Command{
Use: "keyfile",
Short: "Generate a MongoDB keyfile",
Long: `Generate a MongoDB keyfile for replica set authentication.
The keyfile contains 768 bytes of random data (1024 base64 characters), base64 encoded.
File permissions are set to 0400 (read-only for owner) for security.`,
Example: ` # Generate keyfile with default settings (prompts for confirmation)
magi crypto keyfile
# Generate keyfile non-interactively
magi crypto keyfile --yes
# Generate keyfile with custom name and path
magi crypto keyfile --filename my-key --path ./secrets --yes
# Interactive mode
magi crypto keyfile --interactive`,
Run: runGenerateKeyfile,
}
View Source
var KeypairCmd = &cobra.Command{
Use: "keypair",
Short: "Generate a public/private key pair",
Long: `Generate a public/private key pair using RSA, ECDSA, or Ed25519 algorithms.
Keys are saved in PEM format.
Private keys are saved with 0600 permissions.
Public keys are saved with 0644 permissions.`,
Example: ` # Generate RSA key pair (default)
magi crypto keypair
# Generate ECDSA key pair
magi crypto keypair --algorithm ecdsa
# Generate Ed25519 key pair
magi crypto keypair --algorithm ed25519
# Generate only public key from existing private key
magi crypto keypair --public --private-key-path ./private.pem`,
Run: runGenerateKeypair,
}
View Source
var SaltCmd = &cobra.Command{
Use: "salt",
Short: "Generate a random salt key",
Long: `Generate a random salt key of a specified length.`,
Example: ` # Generate a 32-byte salt (default)
magi crypto salt
# Generate a 64-byte salt
magi crypto salt --length 64`,
Run: runGenerateSalt,
}
Functions ¶
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.