Script file serves 2 purposes : Making genration and access of public keys for gpg easier. Using existing key or making a new key for git commits easier.
- Check if gpg keys exist or not.
- IF YES
Ask the user if he wants to create a new key or exit ? - IF NO
Ask the user if he wants to create a new key, access already existing keys or exit ?
- IF YES
- If user requires new key
- Generate new keys
- Add keys in array and access the latest key as variable 'key'
- Ask if he would like to use this key for git commits, or just access the public key or exit
- If he wants to use it for git commit, then
- Ask if he wants the key to be used globally or for the repo
- Execute command based on response
- Exit
- If he wants to access public keys, generate and print public keys and Exit.
- Exit if user choses so.
- If he wants to use it for git commit, then
- If the user wants to access an existing key ,
- Add keys in array
- Ask him the index of array corresponding to key
- Add the key as variable 'key'
- Ask if he would like to use this key for git commits, or just access the public key or exit
- If he wants to use it for git commit, then
- Ask if he wants the key to be used globally or for the repo
- Execute command based on response
- Exit
- If he wants to access public keys, generate and print public keys and Exit.
- Exit if user choses so.
- If he wants to use it for git commit, then
- If the user wants to directly exit, Exit.