#![allow(dead_code)]
use std::io::Read;
use std::io::Seek;
use std::io::Write;
use crate::CryptKey;
pub struct CryptWriter<T: Write> {
_writer: T,
}
impl<T: Write> CryptWriter<T> {
pub fn new(_inner_writable: T, _chunk_size_bytes: usize) -> anyhow::Result<Box<Self>> {
panic!("no crypto support was compiled in this build");
}
pub fn new_from_key(
_inner_writable: T,
_chunk_size_bytes: usize,
_key: &CryptKey,
) -> anyhow::Result<Box<Self>> {
panic!("no crypto support was compiled in this build");
}
}
impl<T: Write> Write for CryptWriter<T> {
fn write(&mut self, _buf: &[u8]) -> std::io::Result<usize> {
panic!("no crypto support was compiled in this build");
}
fn flush(&mut self) -> std::io::Result<()> {
panic!("no crypto support was compiled in this build");
}
}
pub struct CryptReader<T: Read + Seek> {
_reader: T,
}
impl<T> CryptReader<T>
where
T: Read + Seek,
{
pub fn extract_key(_inner_readable: T) -> anyhow::Result<CryptKey> {
panic!("no crypto support was compiled in this build");
}
pub fn from_file_and_key(_inner_readable: T, _key: &CryptKey) -> anyhow::Result<Box<Self>> {
panic!("no crypto support was compiled in this build");
}
}
impl<T> Read for CryptReader<T>
where
T: Read + Seek,
{
fn read(&mut self, _buf: &mut [u8]) -> std::io::Result<usize> {
panic!("no crypto support was compiled in this build");
}
}
pub fn generate_random_key() -> CryptKey {
panic!("no crypto support was compiled in this build");
}