[][src]Function ciph::salsa::load_psk

pub fn load_psk<P: AsRef<Path>>(path: P) -> Result<Psk, LoadPskError>

Load a Psk from a text file. The format of the file is two base64 encoded numbers separated by a newline. The first number is the salsa20 key and the second number is a check value.

example.psk

SY4mnb7WH+S1IZP9QoK2dzpaz/UVtZn0IFhnj6aVocQ=
9opVE44z6wX9CePH8CR9JQJIhQ/VGY3Zs86Tck5KHHtF3yIvzZghrcHntsDnFjgq
k08IXu2hCTsM4dU4PHwcP7f8393iOWvpSnd41YFy+jaXrC7xGXYZBU/A54G/CyCy
bhDE40AyhfhGWcUQ4jTSBn1Y4vp8P8IsgB6l6RnPujY=

To produce a 256bit base64 number, assuming OpenSSL on Linux, use;

openssl rand -base64 32