From 513df8b824cc1c04984a5c3abf6134ecc9419bd8 Mon Sep 17 00:00:00 2001 From: Geoffroy Couprie Date: Tue, 13 Feb 2024 22:50:59 +0100 Subject: [PATCH] remove pkcs8 file loading functions --- biscuit-auth/src/crypto/mod.rs | 16 ---------------- 1 file changed, 16 deletions(-) diff --git a/biscuit-auth/src/crypto/mod.rs b/biscuit-auth/src/crypto/mod.rs index c7ded117..56eb13e5 100644 --- a/biscuit-auth/src/crypto/mod.rs +++ b/biscuit-auth/src/crypto/mod.rs @@ -16,8 +16,6 @@ use ed25519_dalek::*; use nom::Finish; use rand_core::{CryptoRng, RngCore}; -#[cfg(feature = "pem")] -use std::path::Path; use std::{convert::TryInto, fmt::Display, hash::Hash, ops::Drop, str::FromStr}; use zeroize::Zeroize; @@ -58,20 +56,6 @@ impl KeyPair { Ok(KeyPair { kp }) } - #[cfg(feature = "pem")] - pub fn from_private_key_der_file(path: impl AsRef) -> Result { - let kp = SigningKey::read_pkcs8_der_file(path) - .map_err(|e| error::Format::InvalidKey(e.to_string()))?; - Ok(KeyPair { kp }) - } - - #[cfg(feature = "pem")] - pub fn from_private_key_pem_file(path: impl AsRef) -> Result { - let kp = SigningKey::read_pkcs8_pem_file(path) - .map_err(|e| error::Format::InvalidKey(e.to_string()))?; - Ok(KeyPair { kp }) - } - pub fn private(&self) -> PrivateKey { let secret = self.kp.to_bytes(); PrivateKey(secret)