Skip to content

Instantly share code, notes, and snippets.

View umonkey's full-sized avatar
🏠
Working from home

Justin Forest umonkey

🏠
Working from home
View GitHub Profile
@ArtemGr
ArtemGr / verify.rs
Created February 25, 2017 19:26
Using OpenSSL to verify the JWT RS256 signature in Rust.
use openssl::sign::Verifier;
use openssl::rsa::Rsa;
use openssl::pkey::PKey;
use openssl::hash::MessageDigest;
use serde_json::{self as json, Value as Json};
pub fn firebase_id_token (headers: BTreeMap<&str, &str>, mut stream: &mut BufStream<TcpStream>) -> Result<(), String> {
#[derive(Deserialize, Debug)]
struct Post {firebase_id_token: String}