From 5d6abfe2f59d95a8183ba7b42bfb7f6cdabe121d Mon Sep 17 00:00:00 2001 From: Svyatoslav Nikolsky Date: Wed, 22 Nov 2017 11:51:51 +0300 Subject: [PATCH] SecretStore: implemented restore_server_key --- secret_store/src/listener/service_contract_listener.rs | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/secret_store/src/listener/service_contract_listener.rs b/secret_store/src/listener/service_contract_listener.rs index d77cc8135..62a2a387a 100644 --- a/secret_store/src/listener/service_contract_listener.rs +++ b/secret_store/src/listener/service_contract_listener.rs @@ -351,8 +351,11 @@ impl ServiceContractListener { } /// Restore server key. - fn restore_server_key(_data: &Arc, _server_key_id: &ServerKeyId) -> Result { - unimplemented!() // TODO + fn restore_server_key(data: &Arc, server_key_id: &ServerKeyId) -> Result { + data.params.key_storage.get(server_key_id) + .map_err(|e| format!("{}", e)) + .and_then(|ks| ks.ok_or("missing key".to_owned())) + .map(|ks| ks.public) } /// Publish server key.