create_crypto_box method

Future<RegisteredCryptoBox> create_crypto_box(
  1. ParamsOfCreateCryptoBox params
)

Crypto Box is a root crypto object, that encapsulates some secret (seed phrase usually) in encrypted form and acts as a factory for all crypto primitives used in SDK: keys for signing and encryption, derived from this secret.

Crypto Box encrypts original Seed Phrase with salt and password that is retrieved from password_provider callback, implemented on Application side.

When used, decrypted secret shows up in core library's memory for a very short period of time and then is immediately overwritten with zeroes.

Implementation

Future<RegisteredCryptoBox> create_crypto_box(
    ParamsOfCreateCryptoBox params) async {
  final res =
      await _tonCore.request('crypto.create_crypto_box', params.toString());
  return RegisteredCryptoBox.fromMap(res);
}