certstreamrs

Crates.iocertstreamrs
lib.rscertstreamrs
version0.1.1
sourcesrc
created_at2022-03-25 21:57:08.763188
updated_at2022-03-25 22:03:26.182948
descriptionA library for streaming Certificate Transparency Log events from the certstream service
homepage
repositoryhttps://github.com/Andoryuuta/certstream-rs
max_upload_size
id556446
size36,912
Andrew Gutekanst (Andoryuuta)

documentation

README

certstream-rs

An unofficial port of certstream-go to Rust.

MIT licensed Crates.io

This library streams Certificate Transparency Log notifications from https://certstream.calidog.io/ (or a custom instance of the certstream-server).

This was done as a small project to learn Rust. All comments/criticism/pull requests welcome -- the code quality is likely terrible.

Example

> git clone https://github.com/Andoryuuta/certstream-rs
> cd certstream-rs
> cargo run --example watch_hostnames

Usage

use certstreamrs::CertstreamClient;
use futures_util::{pin_mut, StreamExt};

#[tokio::main]
async fn main() {
    // Create the client and open the connection/stream.
    let client = CertstreamClient::default();
    let stream = client.watch_certs();
    pin_mut!(stream);

    // Read from the stream and print the certificate message.
    loop {
        let msg = stream.next().await.unwrap().unwrap();

        println!(
            "Source: {} | First Hostname: {}",
            msg.data.source.name,
            msg.data.leaf_cert.all_domains.first().unwrap()
        );
    }
}
Commit count: 4

cargo fmt