Skip to content

Commit 2da42f7

Browse files
committed
refactor: optimize the unseal api of RustyVault
1 parent 538680a commit 2da42f7

1 file changed

Lines changed: 8 additions & 2 deletions

File tree

src/lib.rs

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -148,8 +148,14 @@ impl RustyVault {
148148
self.core.load().init(seal_config)
149149
}
150150

151-
pub fn unseal(&self, key: &[u8]) -> Result<bool, RvError> {
152-
self.core.load().unseal(key)
151+
pub fn unseal(&self, keys: &[&[u8]]) -> Result<bool, RvError> {
152+
for key in keys.iter() {
153+
if self.core.load().unseal(key)? {
154+
return Ok(true);
155+
}
156+
}
157+
158+
Ok(false)
153159
}
154160

155161
pub fn seal(&self) -> Result<(), RvError> {

0 commit comments

Comments
 (0)