const ( // Name is the program name Name = "SKM" // Usage is for simple description Usage = "Manage your multiple SSH keys easily" // CheckSymbol is the code for check symbol CheckSymbol = "\u2714 " // CrossSymbol is the code for check symbol CrossSymbol = "\u2716 " // PublicKey is the default name of SSH public key PublicKey = "id_rsa.pub" // PrivateKey is the default name of SSH private key PrivateKey = "id_rsa" // DefaultKey is the default alias name of SSH key DefaultKey = "default" // HookName is the name of a hook that is called when present after using a key HookName = "hook" )
AddCache adds SSH to ssh agent cache via key alias
ClearKey clears both private & public keys from SSH key path
CreateLink creates symbol link for specified SSH key
DeleteCache removes SSH key from SSH agent cache via key alias
DeleteKey delete key by its alias name
Execute executes shell commands with arguments
Fatalf output formatted fatal error info
GetBakFileName generates a backup file name by current date and time
IsEmpty checks if directory in path is empty
ListCache lists cached SSH key from SSH agent cache
LoadSSHKeys loads all the SSH keys from key store
ParsePath return the original SSH key path if it is a symbol link
RunHook runs hook file after switching SSH key
Environment abstracts away things like the path the .skm and .ssh folder which allows us to simulate them for testing.
KeyType abstracts configurations for various SSH key types like RSA and ED25519
PrivateKey returns the filename used by a keytype for the private component.
PublicKey returns the filename used by a keytype for the public component.
KeyTypeRegistry is used to store all the supported key types.
SupportedKeyTypes contains all key types supported by skm.
GetByFilename returns a key type object given the name of the private key's file. If no matching key type could be found, then the second return value is false.
SSHKey struct includes both private/public keys & isDefault flag