Struct indy::crypto::Crypto

source ·
pub struct Crypto {}

Implementations

Signs a message with a key

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 Key::create or Did::new
  • message - the data to be signed
Returns

the signature

Signs a message with a key

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 Key::create or Did::new
  • message - the data to be signed
  • timeout - the maximum time this function waits for a response
Returns

the signature

Signs a message with a key

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 Key::create or Did::new
  • message - the data to be signed
  • closure - The closure that is called when finished
Returns

errorcode from calling ffi function

Verify a signature with a verkey

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 Key::create or Did::new
  • message - the data that was signed
  • signature - the signature to verify
Returns

true if signature is valid, false otherwise

Verify a signature with a verkey

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 Key::create or Did::new
  • message - the data that was signed
  • signature - the signature to verify
  • timeout - the maximum time this function waits for a response
Returns

true if signature is valid, false otherwise

Verify a signature with a verkey

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 Key::create or Did::new
  • message - the data that was signed
  • signature - the signature to verify
  • closure - The closure that is called when finished
Returns

errorcode from calling ffi function

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 Key::create 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

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 Key::create or Did::new
  • recipient_vk - key id or verkey of the other party’s key
  • message - the data to be encrypted
  • timeout - the maximum time this function waits for a response
Returns

the encrypted message

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 Key::create or Did::new
  • recipient_vk - key id or verkey of the other party’s key
  • message - the data to be encrypted
  • closure - The closure that is called when finished
Returns

errorcode from calling ffi function

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 Did::get_ver_key to get key id (verkey) for specific DID.

Arguments
  • wallet_handle: wallet handle (created by Wallet::open)
  • recipient_vk: key id or verkey of my key. The key must be created by calling Key::create or Did::new
  • encrypted_message: the message to be decrypted
Returns

sender’s verkey and decrypted message

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 Did::get_ver_key to get key id (verkey) for specific DID.

Arguments
  • wallet_handle: wallet handle (created by Wallet::open)
  • recipient_vk: key id or verkey of my key. The key must be created by calling Key::create or Did::new
  • encrypted_message: the message to be decrypted
  • timeout - the maximum time this function waits for a response
Returns

sender’s verkey and decrypted message

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 Did::get_ver_key to get key id (verkey) for specific DID.

Arguments
  • wallet_handle: wallet handle (created by Wallet::open)
  • recipient_vk: key id or verkey of my key. The key must be created by calling Key::create or Did::new
  • encrypted_message: the message to be decrypted
  • closure - The closure that is called when finished
Returns

errorcode from calling ffi function

Encrypts a message by anonymous-encryption scheme.

Sealed boxes are designed to anonymously send messages to a Recipient given its public key. Only the Recipient can decrypt these messages, using its private key. While the Recipient can verify the integrity of the message, it cannot verify the identity of the Sender.

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)
  • recipient_vk: verkey of message recipient
  • message: a pointer to first byte of message that to be encrypted
Returns

the encrypted message

Encrypts a message by anonymous-encryption scheme.

Sealed boxes are designed to anonymously send messages to a Recipient given its public key. Only the Recipient can decrypt these messages, using its private key. While the Recipient can verify the integrity of the message, it cannot verify the identity of the Sender.

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)
  • recipient_vk: verkey of message recipient
  • message: a pointer to first byte of message that to be encrypted
  • timeout - the maximum time this function waits for a response
Returns

the encrypted message

Encrypts a message by anonymous-encryption scheme.

Sealed boxes are designed to anonymously send messages to a Recipient given its public key. Only the Recipient can decrypt these messages, using its private key. While the Recipient can verify the integrity of the message, it cannot verify the identity of the Sender.

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)
  • recipient_vk: verkey of message recipient
  • message: a pointer to first byte of message that to be encrypted
  • closure - The closure that is called when finished
Returns

errorcode from calling ffi function

Decrypts a message by anonymous-encryption scheme.

Sealed boxes are designed to anonymously send messages to a Recipient given its public key. Only the Recipient can decrypt these messages, using its private key. While the Recipient can verify the integrity of the message, it cannot verify the identity of the Sender.

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).
  • recipient_vk: key id or verkey of my key. The key must be created by calling Key::create or Did::new
  • encrypted_message: a pointer to first byte of message that to be decrypted
Returns

decrypted message

Decrypts a message by anonymous-encryption scheme.

Sealed boxes are designed to anonymously send messages to a Recipient given its public key. Only the Recipient can decrypt these messages, using its private key. While the Recipient can verify the integrity of the message, it cannot verify the identity of the Sender.

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).
  • recipient_vk: key id or verkey of my key. The key must be created by calling Key::create or Did::new
  • encrypted_message: a pointer to first byte of message that to be decrypted
  • timeout - the maximum time this function waits for a response
Returns

decrypted message

Decrypts a message by anonymous-encryption scheme.

Sealed boxes are designed to anonymously send messages to a Recipient given its public key. Only the Recipient can decrypt these messages, using its private key. While the Recipient can verify the integrity of the message, it cannot verify the identity of the Sender.

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).
  • recipient_vk: key id or verkey of my key. The key must be created by calling Key::create or Did::new
  • encrypted_message: a pointer to first byte of message that to be decrypted
  • closure - The closure that is called when finished
Returns

decrypted message

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more
Immutably borrows from an owned value. Read more
Mutably borrows from an owned value. Read more

Returns the argument unchanged.

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

The type returned in the event of a conversion error.
Performs the conversion.
The type returned in the event of a conversion error.
Performs the conversion.