1 2 3 4 5 6 7 8 9 10 11
use openssl::pkey::{self, Private}; use crate::error::Result; /// helper function pub fn create_pkey(pem: &[u8]) -> Result<pkey::PKey<Private>> { let pkey = openssl::pkey::PKey::from_ec_key( openssl::ec::EcKey::private_key_from_pem(pem)?, )?; Ok(pkey) }