Generates a node key pair and a random pre-shared key locally, without network access. Pass the result as the key of a TailcatServer to give a server a stable identity and address across restarts, or pass it as the key of a TailcatClient to give a client a stable public key (useful with allowed_clients).
Arguments
- path
NULL(the default) to return new keys without saving them, or the path of a keys file: if it exists, the keys are loaded from it withtailcat_keys_load(); otherwise new keys are generated and saved there withtailcat_keys_save(). This gives a script the same keys every time it runs.
Value
A list of class tailcat_keys with elements private_key, public_key, and preshared_key, each a string in tailcat's text encoding; private_key and preshared_key are tailcat_secret strings.
Details
The private key and the pre-shared key are secrets. They are tailcat_secret strings, so print(), format(), and str() of the keys, or of the elements, show only the public key and <redacted>. The elements still hold the full values (as.character() or unclass() returns them, and dput() shows them), so store them securely: tailcat_keys_save() writes them to a file only you can read.