Skip to content

Commit

Permalink
remove pkcs8 file loading functions (#208)
Browse files Browse the repository at this point in the history
  • Loading branch information
Geal authored Feb 14, 2024
1 parent 767ed74 commit 8fc071f
Showing 1 changed file with 0 additions and 16 deletions.
16 changes: 0 additions & 16 deletions biscuit-auth/src/crypto/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down Expand Up @@ -58,20 +56,6 @@ impl KeyPair {
Ok(KeyPair { kp })
}

#[cfg(feature = "pem")]
pub fn from_private_key_der_file(path: impl AsRef<Path>) -> Result<Self, error::Format> {
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<Path>) -> Result<Self, error::Format> {
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)
Expand Down

0 comments on commit 8fc071f

Please sign in to comment.