Decode a signature from base32.
(s: &str)
| 76 | |
| 77 | /// Decode a signature from base32. |
| 78 | pub fn from_base32(s: &str) -> Result<Self, IdentityError> { |
| 79 | let bytes = data_encoding::BASE32_NOPAD |
| 80 | .decode(s.as_bytes()) |
| 81 | .map_err(|_| IdentityError::InvalidBase32)?; |
| 82 | |
| 83 | Self::from_slice(&bytes) |
| 84 | } |
| 85 | |
| 86 | /// Verify this signature against a message and public key. |
| 87 | pub fn verify(&self, message: &[u8], public_key: &PublicKey) -> Result<(), IdentityError> { |