Store a signed delegation certificate under its id. `document` is written verbatim — the bytes the proof covers.
(&self, id: &str, document: &str)
| 777 | /// |
| 778 | /// `document` is written verbatim — the bytes the proof covers. |
| 779 | pub fn save_delegation(&self, id: &str, document: &str) -> Result<(), IdentityError> { |
| 780 | let dir = self.delegations_dir(); |
| 781 | if !dir.exists() { |
| 782 | fs::create_dir_all(&dir)?; |
| 783 | } |
| 784 | fs::write(self.delegation_path(id), document)?; |
| 785 | Ok(()) |
| 786 | } |
| 787 | |
| 788 | /// Load a delegation certificate by base32 id. |
| 789 | pub fn load_delegation(&self, id: &str) -> Result<String, IdentityError> { |