Skip to main content

sign_get

Function sign_get 

Source
pub fn sign_get(
    url: &str,
    key_id: &str,
    private_key_pem: &str,
    now: i64,
) -> Result<SignedGet, Error>
Expand description

Sign an outgoing HTTP GET request using RSA-SHA256, for “authorized fetch” (secure mode) servers that require a signed dereference.

A GET has no body, so unlike sign_request it signs only (request-target) host date and produces no Digest.

§Arguments

  • url – Full URL being fetched
  • key_id – keyId URI, typically https://domain/actor#main-key
  • private_key_pem – PKCS#8 or PKCS#1 PEM-encoded RSA private key
  • now – The time, in seconds since the Unix epoch

§Errors

Returns an error if the URL or the key cannot be parsed.