[][src]Function indyrs::crypto::auth_crypt

pub fn auth_crypt(
    wallet_handle: IndyHandle,
    sender_vk: &str,
    recipient_vk: &str,
    message: &[u8]
) -> Box<dyn Future<Item = Vec<u8>, Error = IndyError>>

**** THIS FUNCTION WILL BE DEPRECATED USE pack_message INSTEAD **** Encrypt a message by authenticated-encryption scheme.

Sender can encrypt a confidential message specifically for Recipient, using Sender's public key. Using Recipient's public key, Sender can compute a shared secret key. Using Sender's public key and his secret key, Recipient can compute the exact same shared secret key. That shared secret key can be used to verify that the encrypted message was not tampered with, before eventually decrypting it.

Note to use DID keys with this function you can call Did::get_ver_key to get key id (verkey) for specific DID.

Arguments

  • wallet_handle - wallet handle (created by Wallet::open)
  • signer_vk - key id or verkey of my key. The key must be created by calling create_key or Did::new
  • recipient_vk - key id or verkey of the other party's key
  • message - the data to be encrypted

Returns

the encrypted message