Struct sequoia_net::KeyServer
source · pub struct KeyServer { /* private fields */ }
Expand description
For accessing keyservers using HKP.
Implementations§
source§impl KeyServer
impl KeyServer
sourcepub fn with_cert(p: Policy, uri: &str, cert: Certificate) -> Result<Self>
pub fn with_cert(p: Policy, uri: &str, cert: Certificate) -> Result<Self>
Returns a handle for the given URI.
cert
is used to authenticate the server.
sourcepub fn keys_openpgp_org(p: Policy) -> Result<Self>
pub fn keys_openpgp_org(p: Policy) -> Result<Self>
Returns a handle for keys.openpgp.org.
The server at hkps://keys.openpgp.org
distributes updates
for OpenPGP certificates. It is a good default choice.
sourcepub async fn get<H: Into<KeyHandle>>(&mut self, handle: H) -> Result<Cert>
pub async fn get<H: Into<KeyHandle>>(&mut self, handle: H) -> Result<Cert>
Retrieves the certificate with the given handle.
sourcepub async fn search<U: Into<UserID>>(&mut self, userid: U) -> Result<Vec<Cert>>
pub async fn search<U: Into<UserID>>(&mut self, userid: U) -> Result<Vec<Cert>>
Retrieves certificates containing the given UserID
.
If the given UserID
does not follow the de facto
conventions for userids, or it does not contain a email
address, an error is returned.
Any certificates returned by the server that do not contain the email address queried for are silently discarded.
Warning
Returned certificates must be mistrusted, and be carefully interpreted under a policy and trust model.