Function sequoia_net::wkd::get

source ·
pub async fn get<S: AsRef<str>>(
    c: &Client,
    email_address: S
) -> Result<Vec<Result<Cert>>>
Expand description

Retrieves the Certs that contain userids with a given email address from a Web Key Directory URL.

From draft-koch:

There are two variants on how to form the request URI: The advanced
and the direct method. Implementations MUST first try the advanced
method. Only if the required sub-domain does not exist, they SHOULD
fall back to the direct method.

[...]

The HTTP GET method MUST return the binary representation of the
OpenPGP key for the given mail address.

[...]

Note that the key may be revoked or expired - it is up to the
client to handle such conditions. To ease distribution of revoked
keys, a server may return revoked keys in addition to a new key.
The keys are returned by a single request as concatenated key
blocks.

Examples

let email_address = "foo@bar.baz";
let certs: Vec<Result<Cert>> =
    wkd::get(&reqwest::Client::new(), &email_address).await?;