jsonwebkey-convert 0.3.0

Convert an RSA public key between Json Web Key and DER/PEM format.
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
use super::*;
use jsonwebtoken::DecodingKey;

pub trait ToDecodingKey {
    fn to_decoding_key(&'_ self) -> DecodingKey<'_>;
}

impl ToDecodingKey for RSAPublicKey {
    fn to_decoding_key(&'_ self) -> DecodingKey<'_> {
        DecodingKey::from_rsa_components(&self.n.base64, &self.e.base64)
    }
}