rustcrypto: remove dead trait impl, rename error type
This commit is contained in:
parent
3f875c92b5
commit
6a7acbcb44
|
@ -5,7 +5,7 @@ use sha2::{Digest, Sha256};
|
||||||
use std::fmt::Debug;
|
use std::fmt::Debug;
|
||||||
|
|
||||||
#[derive(Debug, thiserror::Error)]
|
#[derive(Debug, thiserror::Error)]
|
||||||
pub enum RustCryptoError {
|
pub enum RustcryptoError {
|
||||||
#[error(transparent)]
|
#[error(transparent)]
|
||||||
Pkcs8(#[from] rsa::pkcs8::Error),
|
Pkcs8(#[from] rsa::pkcs8::Error),
|
||||||
|
|
||||||
|
@ -63,7 +63,7 @@ impl apub_core::digest::Digest for Sha256Digest {
|
||||||
}
|
}
|
||||||
|
|
||||||
impl apub_core::signature::Sign for RsaSigner {
|
impl apub_core::signature::Sign for RsaSigner {
|
||||||
type Error = RustCryptoError;
|
type Error = RustcryptoError;
|
||||||
|
|
||||||
fn sign(&self, signing_string: &str) -> Result<String, Self::Error> {
|
fn sign(&self, signing_string: &str) -> Result<String, Self::Error> {
|
||||||
let hashed = Sha256::digest(signing_string.as_bytes());
|
let hashed = Sha256::digest(signing_string.as_bytes());
|
||||||
|
@ -78,7 +78,7 @@ impl apub_core::signature::Sign for RsaSigner {
|
||||||
}
|
}
|
||||||
|
|
||||||
impl apub_core::signature::Verify for RsaVerifier {
|
impl apub_core::signature::Verify for RsaVerifier {
|
||||||
type Error = RustCryptoError;
|
type Error = RustcryptoError;
|
||||||
|
|
||||||
fn build(public_key_pem: &str) -> Result<Self, Self::Error>
|
fn build(public_key_pem: &str) -> Result<Self, Self::Error>
|
||||||
where
|
where
|
||||||
|
@ -121,9 +121,6 @@ impl apub_core::signature::SignFactory for Rustcrypto {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
impl apub_core::signature::VerifyFactory for Rustcrypto {
|
|
||||||
type Verifier = RsaVerifier;
|
|
||||||
}
|
|
||||||
|
|
||||||
impl Debug for RsaSigner {
|
impl Debug for RsaSigner {
|
||||||
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
|
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
|
||||||
|
|
Loading…
Reference in a new issue