Open gitmalong opened 2 years ago
@gitmalong Not directly supported.
You may achieve it by the following workaround, for example.
struct DatabaseConfig {
hostname: String,
user: String,
password: EncryptedMessage, // https://docs.rs/serde-encrypt/latest/serde_encrypt/struct.EncryptedMessage.html
}
#[derive(Serialize, Deserialize)]
struct Password(String);
impl SerdeEncryptSharedKey for Password {
type S = BincodeSerializer<Self>;
}
In such a common scenario as outlined below I only want to store the
password
as encrypted value. How can I achieve that?