File: dane-get.rs

package info (click to toggle)
rust-sequoia-net 0.30.0-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 304 kB
  • sloc: makefile: 6
file content (25 lines) | stat: -rw-r--r-- 424 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
//! Demonstrates how retrieve certs via DANE.

use std::{
    env,
    io,
};

use sequoia_openpgp::{
    Result,
    serialize::Serialize,
};

use sequoia_net::dane;

#[tokio::main]
async fn main() -> Result<()> {
    let address = env::args()
        .nth(1).expect("Usage: dane-get <EMAIL-ADDRESS>");

    for cert in dane::get(address).await? {
        cert?.armored().serialize(&mut io::stdout())?;
    }

    Ok(())
}