Delete a certificate and any revocation stored alongside it.
(&self, id: &str)
| 830 | |
| 831 | /// Delete a certificate and any revocation stored alongside it. |
| 832 | pub fn delete_delegation(&self, id: &str) -> Result<(), IdentityError> { |
| 833 | let path = self.delegation_path(id); |
| 834 | if !path.exists() { |
| 835 | return Err(IdentityError::DelegationNotFound { id: id.to_string() }); |
| 836 | } |
| 837 | fs::remove_file(path)?; |
| 838 | let revocation = self.revocation_path(id); |
| 839 | if revocation.exists() { |
| 840 | fs::remove_file(revocation)?; |
| 841 | } |
| 842 | Ok(()) |
| 843 | } |
| 844 | |
| 845 | /// Store a signed revocation for a delegation. |
| 846 | pub fn save_revocation(&self, id: &str, document: &str) -> Result<(), IdentityError> { |