Struct libmaj::key_mgr::key_file::KeyFile
[−]
[src]
pub struct KeyFile { /* fields omitted */ }
The key file contains the (private) data to sign The key file data must be encrypted when at rest API is designed so that secret data do not leak
Methods
impl KeyFile
[src]
fn new() -> Result<KeyFile, String>
Create a new key file. A pk (ECC) key pair.
fn pk_sign(&self, to_sign: &[u8]) -> Result<Vec<u8>, String>
Sign data with a pk private key. Ensure authenticity, not integrity.
fn pk_verify(
public_key_bytes: &[u8],
data_to_verify: &[u8],
signature: &[u8]
) -> Result<bool, String>
public_key_bytes: &[u8],
data_to_verify: &[u8],
signature: &[u8]
) -> Result<bool, String>
fn pk_sign_file<T: AsRef<Path>>(&self, path: T) -> Result<Vec<u8>, String>
fn pk_verify_file<T: AsRef<Path>>(
public_key_bytes: &[u8],
path: T,
signature: &[u8]
) -> Result<bool, String>
public_key_bytes: &[u8],
path: T,
signature: &[u8]
) -> Result<bool, String>
fn get_pk_verification_key(&self) -> Result<Vec<u8>, String>
Get the public key for the pk signature verification
Trait Implementations
impl Debug for KeyFile
[src]
impl Clone for KeyFile
[src]
fn clone(&self) -> KeyFile
Returns a copy of the value. Read more
fn clone_from(&mut self, source: &Self)
1.0.0
Performs copy-assignment from source
. Read more