Skip to main content

serialize_secret

Function serialize_secret 

Source
pub fn serialize_secret(plaintext: &str) -> SshCliResult<String>
Expand description

Serializes a secret for TOML: encrypts if a key exists (or is auto-created); otherwise plaintext.

Empty secret never becomes a blob sshcli-enc (GAP-SSH-EXP-001): export redacted zera passwords and must store readable "", not ciphertext of empty string (which fools import on another machine without the primary-key and fakes “secret present”).

§Errors

Returns an error if key resolution, RNG, or AEAD encryption fails.