-
-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
ffdc588
commit b8a9a9f
Showing
7 changed files
with
109 additions
and
50 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,29 @@ | ||
pub use anyhow::{anyhow, bail, Result}; | ||
use thiserror::Error; | ||
|
||
/// Result type for http signature | ||
pub type HttpSigResult<T> = std::result::Result<T, HttpSigError>; | ||
|
||
/// Error type for http signature | ||
#[derive(Error, Debug)] | ||
pub enum HttpSigError { | ||
#[error("Base64 decode error: {0}")] | ||
Base64DecodeError(#[from] base64::DecodeError), | ||
|
||
/* ----- Crypto errors ----- */ | ||
/// Invalid private key for asymmetric algorithm | ||
#[error("Failed to parse private key: {0}")] | ||
ParsePrivateKeyError(String), | ||
/// Invalid public key for asymmetric algorithm | ||
#[error("Failed to parse public key: {0}")] | ||
ParsePublicKeyError(String), | ||
|
||
/// Signature parse error | ||
#[error("Failed to parse signature: {0}")] | ||
ParseSignatureError(String), | ||
|
||
// #[error("Failed to verify digest: {0}")] | ||
// VerifyDigestError(#[from] ), | ||
/// Invalid Signature | ||
#[error("Invalid Signature: {0}")] | ||
InvalidSignature(String), | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters