Load RSA keys as pem format directly, and using openssl crate, backported from async branch

This commit is contained in:
Daniel García committed 2021-06-25 20:53:26 +02:00
1 parent 2cd17fe7af
commit 46e0f3c43a
7 files changed
+55 -63

No files matched your search

+8
View File
@@ -219,6 +219,14 @@ pub fn read_file(path: &str) -> IOResult<Vec<u8>> {
Ok(contents)
}
pub fn write_file(path: &str, content: &[u8]) -> Result<(), crate::error::Error> {
use std::io::Write;
let mut f = File::create(path)?;
f.write_all(content)?;
f.flush()?;
Ok(())
}
pub fn read_file_string(path: &str) -> IOResult<String> {
let mut contents = String::new();