1use std::fmt;
2
3use zeroize::Zeroize;
4
5#[derive(Clone, Copy, Debug, PartialEq, Eq)]
7pub struct LocalSharedStatePackageContext {
8 pub vault_id: [u8; 32],
9 pub generation_id: [u8; 32],
10}
11
12pub struct LocalSharedStatePackageKey([u8; 32]);
17
18impl Clone for LocalSharedStatePackageKey {
19 fn clone(&self) -> Self {
20 Self(self.0)
21 }
22}
23
24impl LocalSharedStatePackageKey {
25 pub fn new(bytes: [u8; 32]) -> Self {
26 Self(bytes)
27 }
28
29 pub fn protected_storage_bytes(&self) -> &[u8; 32] {
34 &self.0
35 }
36}
37
38impl fmt::Debug for LocalSharedStatePackageKey {
39 fn fmt(&self, formatter: &mut fmt::Formatter<'_>) -> fmt::Result {
40 formatter.write_str("LocalSharedStatePackageKey([REDACTED])")
41 }
42}
43
44impl Drop for LocalSharedStatePackageKey {
45 fn drop(&mut self) {
46 self.0.zeroize();
47 }
48}