Signs a payload using a derived key.
(&self, algorithm: &str, data: Vec<u8>)
| 200 | |
| 201 | /// Signs a payload using a derived key. |
| 202 | pub async fn sign(&self, algorithm: &str, data: Vec<u8>) -> Result<SignResponse> { |
| 203 | let payload = SignRequest { |
| 204 | algorithm, |
| 205 | data: hex_encode(data), |
| 206 | }; |
| 207 | let response = self.send_rpc_request("/Sign", &payload).await?; |
| 208 | let response = serde_json::from_value::<SignResponse>(response)?; |
| 209 | Ok(response) |
| 210 | } |
| 211 | |
| 212 | /// Verifies a payload signature. |
| 213 | pub async fn verify( |