-
Notifications
You must be signed in to change notification settings - Fork 0
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
a7e7c62
commit 70326b3
Showing
7 changed files
with
54 additions
and
33 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,4 @@ | ||
pub mod signable; | ||
pub mod mauth_error; | ||
pub(crate) mod signable; | ||
pub mod signer; | ||
pub mod verifier; |
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 |
---|---|---|
@@ -0,0 +1,19 @@ | ||
use thiserror::Error; | ||
|
||
#[derive(Debug, Error)] | ||
pub enum MAuthError { | ||
#[error("Unable to handle the URL as the format was invalid: {0}")] | ||
UrlFormatError(#[from] std::string::FromUtf8Error), | ||
#[error("Version {0} is not supported")] | ||
UnsupportedVersion(u8), | ||
#[error("Unable to parse RSA private key: {0}")] | ||
PrivateKeyDecodeError(#[from] rsa::pkcs1::Error), | ||
#[error("Unable to parse RSA public key: {0}")] | ||
PublicKeyDecodeError(#[from] spki::Error), | ||
#[error("RSA algorithm error: {0}")] | ||
RsaSignError(#[from] rsa::Error), | ||
#[error("Unable to verify RSA signature: {0}")] | ||
SignatureVerifyError(#[from] rsa::signature::Error), | ||
#[error("Unable to decode base64-encoded signature: {0}")] | ||
SignatureDecodeError(#[from] base64::DecodeError), | ||
} |
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