Skip to main content

sign_request_with_key

Function sign_request_with_key 

Source
pub fn sign_request_with_key(
    method: &str,
    url: &str,
    body: &[u8],
    key_id: &str,
    key: &PrivateKey,
    extra_headers: &[(&str, &str)],
    now: i64,
) -> Result<SignedHeaders, Error>
Expand description

sign_request with a key parsed once by PrivateKey::from_pem.

Parsing an RSA key costs more than signing with it, so a caller that signs often with the same key should parse it once and keep it.

ยงErrors

Returns an error if the URL cannot be parsed.