#certificate-transparency #events #log #streaming #stream #port #certstream

certstreamrs

A library for streaming Certificate Transparency Log events from the certstream service

3 releases

0.1.2 Feb 12, 2025
0.1.1 Mar 25, 2022
0.1.0 Mar 25, 2022

#469 in Asynchronous

Download history 1/week @ 2025-01-30 46/week @ 2025-02-06 92/week @ 2025-02-13 13/week @ 2025-02-20 10/week @ 2025-02-27

162 downloads per month

MIT license

12KB
139 lines

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()
        );
    }
}

Dependencies

~5–17MB
~230K SLoC