* connect to the ups web ui after install and verify the proper certificate is being served
* rename `apchost` flag to `hostname`
* separate ports to additional flags (`sshport` `sslport`) with sane defaults
* apcssh: add descriptive error when required file(s) not passed
* create: dont create key+cert file when key isn't supported by NMC2
* config: fix usage messages re: key types
* p15 files: dont generate key+cert when it isn't needed (aka NMC2 doesn't support key)
* pkcs15: pre-calculate envelope when making the p15 struct
* pkcs15: omit key ID 8 & 9 from EC keys
* pkcs15: update key decode logic
* pkcs15: add key type value for easy determination of compatibility
* pkcs15: add ec key support
* pkcs15: separate functions for key and key+cert p15 files
* update README
see: https://github.com/gregtwallace/apc-p15-tool/issues/6
It was possible for scanner.Scan() to block indefinitely if the UPS never returned the expected prompt regex pattern. This could occur with a UPS using a prompt format I'm not aware of, or if the UPS responds in a non-standard way.
This change ensures that Scan() is aborted after a fixed amount of blocking time and the shell cmd function accordingly returns an error.
Some error messages, comments, and var names are also updated for clarity.
* from ssh videos I found on youtube, the @ symbol might not be present in prompt, so make it optional
* fix typo of 0-0 instead of 0-9 (all numbers are possible in the prompt)
The code should auto-select the native ssl method if the ssl command is available on the UPS.
If this fails, install will drop back to the original install method used by this tool (which works on NMC2).
This was done for clearer separation of function. A subsequent update will (hopefully) make the SSL command more robust so it works for both NMC2 and NMC3.
The method for sending shell commands was also updated to use an interactive shell instead. This allows capturing responses of the commands which will be needed to deduce if devices are NMC2 or NMC3.
When troubleshooting it is helpful to put the generated files into an asn1 decoder. The files can be copy/pasted easily in b64 format.
This change creates b64 files when the debug flag is set to make this process easier.
The NMC Security Wizard can also produce .p15 files that contain just a private key. Add this ability to this tool.
When the `create` function is used, both files will be outputted.