Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var CommonKeyNames = []string{
"id_rsa",
"id_ed25519",
"id_ecdsa",
"id_dsa",
"id_ed25519_sk",
"identity",
}
CommonKeyNames are typical SSH key filenames to look for
Functions ¶
This section is empty.
Types ¶
type Generator ¶
type Generator struct {
// contains filtered or unexported fields
}
Generator handles SSH key generation
func NewGenerator ¶
func (*Generator) Generate ¶
func (g *Generator) Generate(opts GeneratorOptions) error
Generate generates a new SSH key
type GeneratorOptions ¶
type GeneratorOptions struct {
Name string // Key name (e.g., "id_ed25519")
Type KeyType // Key type
Bits int // Bit length (for RSA)
Comment string // Optional comment
Passphrase string // Optional passphrase
}
GeneratorOptions contains options for SSH key generation
type Key ¶
type Key struct {
Name string // Base filename (e.g., "id_rsa")
Path string // Full path to the private key
PublicKeyPath string // Full path to the public key
Type KeyType // Key type (RSA, ED25519, etc.)
Fingerprint string // SHA256 fingerprint
FingerprintMD5 string // MD5 fingerprint (legacy)
Comment string // Key comment if present
BitLength int // Bit length for RSA/DSA keys
Created time.Time // Creation time
Modified time.Time // Modification time
HasPrivate bool // Whether private key exists
HasPublic bool // Whether public key exists
IsEncrypted bool // Whether private key is encrypted
PublicKey string // Public key content
}
Key represents an SSH key with its metadata
Click to show internal directories.
Click to hide internal directories.