Store a signed delegation certificate under its id. `document` is written verbatim — the bytes the proof covers.
(&self, id: &str, document: &str)
| 843 | /// |
| 844 | /// `document` is written verbatim — the bytes the proof covers. |
| 845 | pub fn save_delegation(&self, id: &str, document: &str) -> Result<(), IdentityError> { |
| 846 | let dir = self.delegations_dir(); |
| 847 | if !dir.exists() { |
| 848 | fs::create_dir_all(&dir)?; |
| 849 | } |
| 850 | fs::write(self.delegation_path(id), document)?; |
| 851 | Ok(()) |
| 852 | } |
| 853 | |
| 854 | /// Load a delegation certificate by base32 id. |
| 855 | pub fn load_delegation(&self, id: &str) -> Result<String, IdentityError> { |