Function serialize_secret_string

Source
pub fn serialize_secret_string<S>(
    secret: &SecretString,
    serializer: S,
) -> Result<S::Ok, S::Error>
where S: Serializer,
Expand description

Helper function to serialize secrets as encrypted base64 for storage.

Uses AAD from EncryptionContext to bind the ciphertext to its storage location. The EncryptionContext must be set before calling this function.