Revoke a key.
(&self, key_id: &str)
| 208 | |
| 209 | /// Revoke a key. |
| 210 | pub fn revoke(&self, key_id: &str) -> bool { |
| 211 | let mut keys = self.keys.write().unwrap_or_else(|p| p.into_inner()); |
| 212 | if let Some(key) = keys.get_mut(key_id) { |
| 213 | key.is_revoked = true; |
| 214 | true |
| 215 | } else { |
| 216 | false |
| 217 | } |
| 218 | } |
| 219 | |
| 220 | /// Rotate a key: create a new key that replaces the old one. |
| 221 | /// Both are valid during the overlap period. |