pub fn ecdsa_keypair_from_file(
        algorithm: SignatureAlgorithm,
        path: &str,
    ) -> Result<Self, Error> {
        let der = Self::read_bytes(path)?;
        let ring_algorithm = match algorithm {
            SignatureAlgorithm::ES256 => &signature::ECDSA_P256_SHA256_FIXED_SIGNING,
            SignatureAlgorithm::ES384 => &signature::ECDSA_P384_SHA384_FIXED_SIGNING,
            _ => return Err(Error::UnsupportedOperation),
        };
        let key_pair = signature::EcdsaKeyPair::from_pkcs8(ring_algorithm, der.as_slice())?;
        Ok(Secret::EcdsaKeyPair(Arc::new(key_pair)))
    }
/// Convenience function to get the ECDSA Keypair from a PKCS8-DER encoded EC private key.
Convenience function to get the ECDSA Keypair from a PKCS8-DER encoded EC private key.
Convenience function to get the ECDSA Keypair from a PKCS8 - DER encoded EC private key .
pub fn ecdsa_keypair_from_file(
        algorithm: SignatureAlgorithm,
        path: &str,
    ) -> Result<Self, Error> {
        let der = Self::read_bytes(path)?;
        let ring_algorithm = match algorithm {
            SignatureAlgorithm::ES256 => &signature::ECDSA_P256_SHA256_FIXED_SIGNING,
            SignatureAlgorithm::ES384 => &signature::ECDSA_P384_SHA384_FIXED_SIGNING,
            _ => return Err(Error::UnsupportedOperation),
        };
        let key_pair = signature::EcdsaKeyPair::from_pkcs8(ring_algorithm, der.as_slice())?;
        Ok(Secret::EcdsaKeyPair(Arc::new(key_pair)))
    }
pub fn ecdsa_keypair_from_file ( algorithm : SignatureAlgorithm , path : & str , ) -> Result < Self , Error > { let der = Self :: read_bytes ( path ) ? ; let ring_algorithm = match algorithm { SignatureAlgorithm :: ES256 => & signature :: ECDSA_P256_SHA256_FIXED_SIGNING , SignatureAlgorithm :: ES384 => & signature :: ECDSA_P384_SHA384_FIXED_SIGNING , _ => return Err ( Error :: UnsupportedOperation ) , } ; let key_pair = signature :: EcdsaKeyPair :: from_pkcs8 ( ring_algorithm , der . as_slice ( ) ) ? ; Ok ( Secret :: EcdsaKeyPair ( Arc :: new ( key_pair ) ) ) }
Convenience function to get the ECDSA Keypair from a PKCS8-DER encoded EC private key.
Convenience function to get the ECDSA Keypair from a PKCS8 - DER encoded EC private key .
algorithm
SignatureAlgorithm
path
&str
algorithm
SignatureAlgorithm
path
&str