From 5638a660c2e250dfd7f6d41d0376ef676f80fcba Mon Sep 17 00:00:00 2001 From: occheung Date: Thu, 5 Nov 2020 14:08:52 +0800 Subject: [PATCH] cert: remove dead code --- src/certificate.rs | 17 ----------------- 1 file changed, 17 deletions(-) diff --git a/src/certificate.rs b/src/certificate.rs index 186c2fe..fbe5f06 100644 --- a/src/certificate.rs +++ b/src/certificate.rs @@ -154,24 +154,7 @@ pub struct AlgorithmIdentifier<'a> { } impl<'a> Certificate<'a> { - // Return the public key, if used for RSA - pub fn return_rsa_public_key(&self) -> Result { - if self.signature_algorithm.algorithm != SHA1_WITH_RSA_ENCRYPTION { - return Err(()); - } - let (_, (modulus, exponent)) = parse_asn1_der_rsa_public_key( - self.tbs_certificate.subject_public_key_info.subject_public_key - ).map_err(|_| ())?; - - RSAPublicKey::new( - BigUint::from_bytes_be(modulus), - BigUint::from_bytes_be(exponent) - ).map_err(|_| ()) - } - // General return public key method - // TODO: Replace return_rsa_public_key() with this method - // Things to change: session.rs: client_update_for_wait_cert_cr pub(crate) fn get_cert_public_key(&self) -> Result { let public_key_info = &self.tbs_certificate.subject_public_key_info; let algorithm_identifier = &public_key_info.algorithm;