pub struct Encryptor { /* private fields */ }
Implementations§
Source§impl Encryptor
impl Encryptor
pub fn try_new(private: NodePrivateKey) -> EncryptorResult<Self>
Trait Implementations§
Source§impl EncryptorT for Encryptor
impl EncryptorT for Encryptor
Source§fn encrypt(&self, addr: Option<&str>, text: &[u8]) -> EncryptorResult<Vec<u8>>
fn encrypt(&self, addr: Option<&str>, text: &[u8]) -> EncryptorResult<Vec<u8>>
Encrypt the message use RSA public key
Source§fn decrypt(&self, text: &[u8]) -> EncryptorResult<Vec<u8>>
fn decrypt(&self, text: &[u8]) -> EncryptorResult<Vec<u8>>
Decrypt the message use RSA private key
fn gen_secret(&self) -> SecretKey
fn sign_raw(&self, message: &[u8]) -> EncryptorResult<Vec<u8>>
fn sign(&self, message: &[u8], signer: String) -> EncryptorResult<Signature>
fn verify_raw( &self, addr: Option<&str>, message: &[u8], signature: &[u8], ) -> EncryptorResult<()>
fn verify(&self, message: &[u8], signature: &Signature) -> EncryptorResult<()>
fn apply(&self, secret: &SecretKey, buffer: &mut [u8])
fn apply_multi(&self, secrets: Vec<SecretKey>, buffer: &mut [u8])
fn shuffle(&self, items: &mut Vec<Ciphertext>)
fn add_public_key( &self, addr: String, raw: &NodePublicKeyRaw, ) -> EncryptorResult<()>
fn digest(&self, text: &[u8]) -> SecretDigest
fn export_public_key( &self, addr: Option<&str>, ) -> EncryptorResult<NodePublicKeyRaw>
fn decrypt_with_secrets( &self, ciphertext_map: HashMap<usize, Vec<u8>>, secret_map: HashMap<usize, Vec<Vec<u8>>>, valid_options: &[String], ) -> Result<HashMap<usize, String>, EncryptorError>
Auto Trait Implementations§
impl !Freeze for Encryptor
impl RefUnwindSafe for Encryptor
impl Send for Encryptor
impl Sync for Encryptor
impl Unpin for Encryptor
impl UnwindSafe for Encryptor
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more