httpsig-rs
Work in Progress
Implementation of IETF RFC 9421 of http message signatures.
This crates provides a basic library httpsig and its extension of hyper
's http library. At this point, our library can sign and verify request and response messages of only hyper
.
Supported Signature Algorithms
- HMAC using SHA-256
- Ed25519
- ECDSA-P256 using SHA-256
- ECDSA-P384 using SHA-384
- [ ] RSASSA-PSS using SHA-512
- [ ] RSASSA-PKCS1-v1_5 using SHA-256
At this point, we have no plan to support RSA signature due to the problem related to the non-constant time operation, i.e., Mervin Attack.
Usage of Extension for hyper
(httpsig-hyper
)
This is a case signing and verifying a signature generated with asymmetric cryptography (like EdDSA), where PUBLIC_KEY_STRING
and SECRET_KEY_STRING
is a public and private keys in PEM format, respectively. Generating and verifying a MAC through symmetric crypto (HMAC-SHA256) is also supported.
Signing and Verifying a Request
use Request;
use Full;
use ;
type SignatureName = String;
const COVERED_COMPONENTS: & = &;
/// Signer function that generates a request with a signature
async
/// Validation function that verifies a request with a signature
async
async
Signing and Verifying a Response
use ;
use Full;
use ;
type SignatureName = String;
/// This includes the method of the request corresponding to the request (the second element)
const COVERED_COMPONENTS: & = &;
/// Signer function that generates a response with a signature from response itself and corresponding request
async
/// Validation function that verifies a response with a signature from response itself and sent request
async
Examples
See ./httpsig-hyper/examples for detailed examples with hyper
extension.