You are an expert in writing code in many different languages. Your goal is to perform code completion for the following code, keeping in mind the rest of the code and the file meta data.
    Metadata details:
    filename: keymgmt.rs
    path of file: ./repos/fluvio/crates/fluvio-hub-util/src
    
    the code of the file until where you have to start completion: //! Key Mgmt module provides a thin abstraction over the public key
//! signing and validation ed25519-dalek crate
//! ed25519-dalek is a common crate between jwt token crates, package signing/verification
//! and ssh key representations.

use std::io::Write;

use ed25519_dalek::{Signer, Verifier};
use pem:
    
    pub fn read_from_file(fname: &str) -> Result<PublicKey> {
        let buf = std::fs::read(fname)?;
        let pem = pem::parse(buf).map_err(|_| HubError::InvalidPublicKeyFile(fname.into()))?;
        if pem.tag() != PUBLIC_KEY_TAG {
            return Err(HubError::InvalidPublicKeyFile(fname.into()));
        }
        let key = pem.contents().try_into().map_err(|_| HubError::KeyVerify)?;
        let pubkey =
            ed25519_dalek::VerifyingKey::from_bytes(key).map_err(|_| HubError::KeyVerify)?;
        Ok(PublicKey { pubkey })
    }