Function libindy_sys::indy_crypto_auth_decrypt[][src]

pub unsafe extern "C" fn indy_crypto_auth_decrypt(
    command_handle: indy_handle_t,
    wallet_handle: indy_handle_t,
    recipient_vk: *const c_char,
    encrypted_msg_raw: *const indy_u8_t,
    encrypted_msg_len: indy_u32_t,
    cb: indy_str_slice_cb
) -> indy_error_t

Decrypt 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 indy_key_for_did to get key id (verkey) for specific DID.

#Params command_handle: command handle to map callback to user context. wallet_handle: wallet handler (created by open_wallet). recipient_vk: id (verkey) of my key. The key must be created by calling indy_create_key or indy_create_and_store_my_did encrypted_msg_raw: a pointer to first byte of message that to be decrypted encrypted_msg_len: a message length cb: Callback that takes command result as parameter.

#Returns sender verkey and decrypted message as a pointer to array of bytes

#Errors Common* Wallet* Crypto*