I want to use Rust's zeroize crate for zeroizing BTreeMap entries. But zeroize doesn't seems to provide an out-of-the-box implementation for BTreeMap.
Currently, I'm resorting to clear to remove the map's entries.
Q1. How safe is it to use simply clear out my secrets stored in the map & without zeroizing them?
Q2. How can I use zeroize with std::collection::BTreeMap
? I think I've to iterate over each element to zeroize it. An additional complexity with this approach is that my map contains "complex" generic structs. So will I have to zeroize turtle all the way down?
Q2.a) Any other crates that might help me with zeroizing BTreeMap like mine?
My struct eg:
let my_map1: BTreeMap<usize, MyStruct1<G1Projective>> = BTreeMap::new();
#[derive(Clone, Debug, Serialize, Deserialize)]
struct MyStruct1<G: MyTrait1 + MyTrait2> {
#[serde(serialize_with: .., deserialize_with: ..)]
field1: G,
#[serde(serialize_with: .., deserialize_with: ..)]
field2: Vec<G>,
}