Class gateway

Namespace: keychain

#include "keychain/gateway/gateway.hpp"

Inheritance: gateway

Gateway

gateway performs application-level cryptographic operations encrypt, decrypt, sign, and verify.

Static Methods

Return type Method and Description

kc::code

init(kc::settings& settings, std::string config_path, std::string db_path, bool force_clean, std::string drop_sql_file, std::string create_sql_file);

Initialize module.

Constructor Summary

Constructor

gateway(std::string db_path, kc::settings settings)

gateway() = delete

gateway(const kc::gateway&) = delete

gateway(kc::gateway&&) = delete

kc::gateway& operator=(const kc::gateway&) = delete

kc::gateway& operator=(kc::gateway&&) = delete

Instance Methods

Return type Method and Description

kc::code

add_signature( std::string &signed_text, const std::string &clear_text, tkc::key_id_type pub_key_spec_type = tkc::key_id_type::txid_vout)

Add a signature to a signed message.

kc::code

create_asset(kc::asset &asset, std::string asset_name)

Create/issue custom digital asset.

kc::code

create_contact(kc::contact&, const std::string &name, const std::string &sub_name, kc::uri uri)

Create a contact.

kc::code

create_persona(kc::persona &persona, std::string name, std::string sub_name, kc::security_level sec_level)

Create a new persona.

kc::code

decrypt(std::string &clear_text, tkc::char_encoding &cleartext_char_encoding, const std::string &cipher_text_xml)

Decrypt to a string (binary or not).

kc::code

decrypt_then_verify( std::string &clear_text, tkc::char_encoding &char_encoding, std::vector<kc::verification>& result, const std::string &cipher_text_xml)

Decrypt then verify data that has been signed and encrypted as a string.

kc::code

delete_facade(kc::facade facade)

Delete a facade (persona or contact).

kc::code

encrypt( std::string &cipher_text_xml, const std::string &clear_text, const std::vector<kc::contact> &dest_names, tkc::char_encoding encoding = tkc::char_encoding::utf8, tkc::cipher cipher = tkc::cipher::aes_gcm_128, tkc::key_id_type pub_key_spec_type = tkc::key_id_type::txid_vout)

Encrypt a string so that it can be decrypted by the given contacts.

kc::code

force_update_cache()

Force update blockchain cache state.

kc::code

get_active_persona(kc::persona &persona)

Get the active persona.

kc::code

get_contacts(std::vector<kc::contact> &contacts)

Get the set of contacts for the current active persona.

kc::code

get_personas(std::vector<kc::persona> &personas)

Get set of personas.

kc::code

hash(std::string& hash_result_hex, std::string clear_text)

Hash data from a string.

kc::code

rename_facade(kc::facade, std::string new_name, std::string new_subname)

Rename a facade (persona or contact).

kc::code

renew_certificate(kc::persona persona)

Renew the given persona’s certificate.

kc::code

seed(std::string &address, std::vector<std::string> &mnemonic_list)

Seed the private key pool and generate mnemonic recovery string.

kc::code

set_active_persona(persona persona)

Set the active persona.

kc::code

sign( std::string &signed_text, const std::string &clear_text, const kc::persona&, tkc::key_id_type pub_key_spec_type = tkc::key_id_type::txid_vout)

Sign a string.

int

sign_then_encrypt( std::string &cipher_text_xml, const std::string &clear_text, const std::vector<kc::contact> &dest_names, const kc::persona&, tkc::char_encoding encoding = tkc::char_encoding::utf8, tkc::cipher cipher = tkc::cipher::aes_gcm_128, tkc::key_id_type pub_key_spec_type = tkc::key_id_type::txid_vout)

Sign then encrypt a string so that it can be decrypted (and verified) by the given contacts.

kc::code

transfer_asset(kc::transaction &trxn, kc::asset asset, kc::contact receiver, long amount)

Create a transaction to send the asset to the specified receiver.

kc::code

update_ledger(kc::transaction trxn)

Update local ledger with transaction/response from peers.

kc::code

verify( std::vector<kc::verification>& result, std::string& message, const std::string& signed_msg, const kc::persona& persona)

Verify the signature(s) of a signed string.