identity_storage/storage/
mod.rs1mod error;
7#[macro_use]
8mod jwk_document_ext;
9#[cfg(feature = "hybrid")]
10mod hybrid_jws_document_ext;
11#[cfg(feature = "jpt-bbs-plus")]
12mod jwp_document_ext;
13#[cfg(feature = "pqc")]
14mod pqc_jws_document_ext;
15mod signature_options;
16#[cfg(feature = "jpt-bbs-plus")]
17mod timeframe_revocation_ext;
18
19mod did_jwk_document_ext;
20
21#[cfg(feature = "storage-signer")]
22mod storage_signer;
23#[cfg(all(test, feature = "memstore"))]
24pub(crate) mod tests;
25
26pub use error::*;
27
28#[cfg(feature = "hybrid")]
29pub use hybrid_jws_document_ext::*;
30pub use jwk_document_ext::*;
31#[cfg(feature = "jpt-bbs-plus")]
32pub use jwp_document_ext::*;
33#[cfg(feature = "pqc")]
34pub use pqc_jws_document_ext::*;
35pub use signature_options::*;
36#[cfg(feature = "storage-signer")]
37pub use storage_signer::*;
38#[cfg(feature = "jpt-bbs-plus")]
39pub use timeframe_revocation_ext::*;
40
41pub use did_jwk_document_ext::*;
42
43pub struct Storage<K, I> {
47 key_storage: K,
48 key_id_storage: I,
49}
50
51impl<K, I> Storage<K, I> {
52 pub fn new(key_storage: K, key_id_storage: I) -> Self {
54 Self {
55 key_storage,
56 key_id_storage,
57 }
58 }
59
60 pub fn key_storage(&self) -> &K {
62 &self.key_storage
63 }
64
65 pub fn key_id_storage(&self) -> &I {
67 &self.key_id_storage
68 }
69}
70
71#[cfg(feature = "keytool")]
72mod keytool {
73 use super::Storage;
74 use iota_interaction::KeytoolStorage as Keytool;
75
76 pub type KeytoolStorage = Storage<Keytool, Keytool>;
78
79 impl From<Keytool> for KeytoolStorage {
80 fn from(keytool: Keytool) -> Self {
81 KeytoolStorage::new(keytool.clone(), keytool)
82 }
83 }
84}
85
86#[cfg(feature = "keytool")]
87pub use keytool::*;