Class: TonClient::Crypto
- Includes:
- CommonInstanceHelpers
- Defined in:
- lib/everscale-client-ruby/Client/Crypto.rb
Constant Summary collapse
- MODULE =
self.to_s.downcase.gsub(/^(.+::|)(\w+)$/, '\2').freeze
Instance Attribute Summary collapse
-
#context ⇒ Object
readonly
Returns the value of attribute context.
-
#request_id ⇒ Object
readonly
Returns the value of attribute request_id.
-
#requests ⇒ Object
readonly
Returns the value of attribute requests.
Instance Method Summary collapse
-
#chacha20(payload, &block) ⇒ Object
INPUT: ParamsOfChaCha20 data: String - # # Source data to be encrypted or decrypted.
-
#clear_crypto_box_secret_cache(payload, &block) ⇒ Object
INPUT: RegisteredCryptoBox handle: CryptoBoxHandle -.
-
#convert_public_key_to_ton_safe_format(payload, &block) ⇒ Object
INPUT: ParamsOfConvertPublicKeyToTonSafeFormat public_key: String - # # Public key - 64 symbols hex string RESPONSE: ResultOfConvertPublicKeyToTonSafeFormat ton_public_key: String - # # Public key represented in TON safe format.
-
#create_crypto_box(payload, &block) ⇒ Object
INPUT: ParamsOfCreateCryptoBox secret_encryption_salt: String - # # Salt used for secret encryption.
-
#create_encryption_box(payload, &block) ⇒ Object
INPUT: ParamsOfCreateEncryptionBox algorithm: EncryptionAlgorithm - # # Encryption algorithm specifier including cipher parameters (key, IV, etc) RESPONSE: RegisteredEncryptionBox handle: EncryptionBoxHandle - # # Handle of the encryption box.
-
#encryption_box_decrypt(payload, &block) ⇒ Object
INPUT: ParamsOfEncryptionBoxDecrypt encryption_box: EncryptionBoxHandle - # # Encryption box handle data: String - # # Data to be decrypted, encoded in Base64 RESPONSE: ResultOfEncryptionBoxDecrypt data: String - # # Decrypted data, encoded in Base64.
-
#encryption_box_encrypt(payload, &block) ⇒ Object
INPUT: ParamsOfEncryptionBoxEncrypt encryption_box: EncryptionBoxHandle - # # Encryption box handle data: String - # # Data to be encrypted, encoded in Base64 RESPONSE: ResultOfEncryptionBoxEncrypt data: String - # # Encrypted data, encoded in Base64.
-
#encryption_box_get_info(payload, &block) ⇒ Object
INPUT: ParamsOfEncryptionBoxGetInfo encryption_box: EncryptionBoxHandle - # # Encryption box handle RESPONSE: ResultOfEncryptionBoxGetInfo info: EncryptionBoxInfo - # # Encryption box information.
-
#factorize(payload, &block) ⇒ Object
INPUT: ParamsOfFactorize composite: String - # # Hexadecimal representation of u64 composite number.
-
#generate_random_bytes(payload, &block) ⇒ Object
INPUT: ParamsOfGenerateRandomBytes length: Number - # # Size of random byte array.
-
#generate_random_sign_keys(&block) ⇒ Object
RESPONSE: KeyPair public: String - # # Public key - 64 symbols hex string secret: String - # # Private key - u64 symbols hex string.
-
#get_crypto_box_info(payload, &block) ⇒ Object
INPUT: RegisteredCryptoBox handle: CryptoBoxHandle - RESPONSE: ResultOfGetCryptoBoxInfo encrypted_secret: String - # # Secret (seed phrase) encrypted with salt and password.
-
#get_crypto_box_seed_phrase(payload, &block) ⇒ Object
INPUT: RegisteredCryptoBox handle: CryptoBoxHandle - RESPONSE: ResultOfGetCryptoBoxSeedPhrase phrase: String - dictionary: MnemonicDictionary - wordcount: Number -.
-
#get_encryption_box_from_crypto_box(payload, &block) ⇒ Object
INPUT: ParamsOfGetEncryptionBoxFromCryptoBox handle: Number - # # Crypto Box Handle.
-
#get_signing_box(payload, &block) ⇒ Object
INPUT: KeyPair public: String - # # Public key - 64 symbols hex string secret: String - # # Private key - u64 symbols hex string RESPONSE: RegisteredSigningBox handle: SigningBoxHandle - # # Handle of the signing box.
-
#get_signing_box_from_crypto_box(payload, &block) ⇒ Object
INPUT: ParamsOfGetSigningBoxFromCryptoBox handle: Number - # # Crypto Box Handle.
-
#hdkey_derive_from_xprv(payload, &block) ⇒ Object
INPUT: ParamsOfHDKeyDeriveFromXPrv xprv: String - # # Serialized extended private key child_index: Number - # # Child index (see BIP-0032) hardened: Boolean - # # Indicates the derivation of hardened/not-hardened key (see BIP-0032) RESPONSE: ResultOfHDKeyDeriveFromXPrv xprv: String - # # Serialized extended private key.
-
#hdkey_derive_from_xprv_path(payload, &block) ⇒ Object
INPUT: ParamsOfHDKeyDeriveFromXPrvPath xprv: String - # # Serialized extended private key path: String - # # Derivation path, for instance “m/44’/396’/0’/0/0” RESPONSE: ResultOfHDKeyDeriveFromXPrvPath xprv: String - # # Derived serialized extended private key.
-
#hdkey_public_from_xprv(payload, &block) ⇒ Object
INPUT: ParamsOfHDKeyPublicFromXPrv xprv: String - # # Serialized extended private key RESPONSE: ResultOfHDKeyPublicFromXPrv public: String - # # Public key - 64 symbols hex string.
-
#hdkey_secret_from_xprv(payload, &block) ⇒ Object
INPUT: ParamsOfHDKeySecretFromXPrv xprv: String - # # Serialized extended private key RESPONSE: ResultOfHDKeySecretFromXPrv secret: String - # # Private key - 64 symbols hex string.
-
#hdkey_xprv_from_mnemonic(payload, &block) ⇒ Object
INPUT: ParamsOfHDKeyXPrvFromMnemonic phrase: String - # # String with seed phrase dictionary: MnemonicDictionary - # # Dictionary identifier word_count: Number<Optional> - # # Mnemonic word count RESPONSE: ResultOfHDKeyXPrvFromMnemonic xprv: String - # # Serialized extended master private key.
-
#initialize(context: nil, request_id: nil, requests: nil) ⇒ Crypto
constructor
A new instance of Crypto.
-
#mnemonic_derive_sign_keys(payload, &block) ⇒ Object
INPUT: ParamsOfMnemonicDeriveSignKeys phrase: String - # # Phrase path: String<Optional> - # # Derivation path, for instance “m/44’/396’/0’/0/0” dictionary: MnemonicDictionary - # # Dictionary identifier word_count: Number<Optional> - # # Word count RESPONSE: KeyPair public: String - # # Public key - 64 symbols hex string secret: String - # # Private key - u64 symbols hex string.
-
#mnemonic_from_entropy(payload, &block) ⇒ Object
INPUT: ParamsOfMnemonicFromEntropy entropy: String - # # Entropy bytes.
-
#mnemonic_from_random(payload, &block) ⇒ Object
INPUT: ParamsOfMnemonicFromRandom dictionary: MnemonicDictionary - # # Dictionary identifier word_count: Number<Optional> - # # Mnemonic word count RESPONSE: ResultOfMnemonicFromRandom phrase: String - # # String of mnemonic words.
-
#mnemonic_verify(payload, &block) ⇒ Object
INPUT: ParamsOfMnemonicVerify phrase: String - # # Phrase dictionary: MnemonicDictionary - # # Dictionary identifier word_count: Number<Optional> - # # Word count RESPONSE: ResultOfMnemonicVerify valid: Boolean - # # Flag indicating if the mnemonic is valid or not.
-
#mnemonic_words(payload, &block) ⇒ Object
INPUT: ParamsOfMnemonicWords dictionary: MnemonicDictionary - # # Dictionary identifier RESPONSE: ResultOfMnemonicWords words: String - # # The list of mnemonic words.
-
#modular_power(payload, &block) ⇒ Object
INPUT: ParamsOfModularPower base: String - # #
baseargument of calculation. -
#nacl_box(payload, &block) ⇒ Object
INPUT: ParamsOfNaclBox decrypted: String - # # Data that must be encrypted encoded in
base64. -
#nacl_box_keypair(&block) ⇒ Object
RESPONSE: KeyPair public: String - # # Public key - 64 symbols hex string secret: String - # # Private key - u64 symbols hex string.
-
#nacl_box_keypair_from_secret_key(payload, &block) ⇒ Object
INPUT: ParamsOfNaclBoxKeyPairFromSecret secret: String - # # Secret key - unprefixed 0-padded to 64 symbols hex string RESPONSE: KeyPair public: String - # # Public key - 64 symbols hex string secret: String - # # Private key - u64 symbols hex string.
-
#nacl_box_open(payload, &block) ⇒ Object
INPUT: ParamsOfNaclBoxOpen encrypted: String - # # Data that must be decrypted.
-
#nacl_secret_box(payload, &block) ⇒ Object
INPUT: ParamsOfNaclSecretBox decrypted: String - # # Data that must be encrypted.
-
#nacl_secret_box_open(payload, &block) ⇒ Object
INPUT: ParamsOfNaclSecretBoxOpen encrypted: String - # # Data that must be decrypted.
-
#nacl_sign(payload, &block) ⇒ Object
INPUT: ParamsOfNaclSign unsigned: String - # # Data that must be signed encoded in
base64. -
#nacl_sign_detached(payload, &block) ⇒ Object
INPUT: ParamsOfNaclSign unsigned: String - # # Data that must be signed encoded in
base64. -
#nacl_sign_detached_verify(payload, &block) ⇒ Object
INPUT: ParamsOfNaclSignDetachedVerify unsigned: String - # # Unsigned data that must be verified.
-
#nacl_sign_keypair_from_secret_key(payload, &block) ⇒ Object
INPUT: ParamsOfNaclSignKeyPairFromSecret secret: String - # # Secret key - unprefixed 0-padded to 64 symbols hex string RESPONSE: KeyPair public: String - # # Public key - 64 symbols hex string secret: String - # # Private key - u64 symbols hex string.
-
#nacl_sign_open(payload, &block) ⇒ Object
INPUT: ParamsOfNaclSignOpen signed: String - # # Signed data that must be unsigned.
-
#register_encryption_box(&block) ⇒ Object
RESPONSE: RegisteredEncryptionBox handle: EncryptionBoxHandle - # # Handle of the encryption box.
-
#register_signing_box(&block) ⇒ Object
RESPONSE: RegisteredSigningBox handle: SigningBoxHandle - # # Handle of the signing box.
-
#remove_crypto_box(payload, &block) ⇒ Object
INPUT: RegisteredCryptoBox handle: CryptoBoxHandle -.
-
#remove_encryption_box(payload, &block) ⇒ Object
INPUT: RegisteredEncryptionBox handle: EncryptionBoxHandle - # # Handle of the encryption box.
-
#remove_signing_box(payload, &block) ⇒ Object
INPUT: RegisteredSigningBox handle: SigningBoxHandle - # # Handle of the signing box.
-
#scrypt(payload, &block) ⇒ Object
INPUT: ParamsOfScrypt password: String - # # The password bytes to be hashed.
-
#sha256(payload, &block) ⇒ Object
INPUT: ParamsOfHash data: String - # # Input data for hash calculation.
-
#sha512(payload, &block) ⇒ Object
INPUT: ParamsOfHash data: String - # # Input data for hash calculation.
-
#sign(payload, &block) ⇒ Object
INPUT: ParamsOfSign unsigned: String - # # Data that must be signed encoded in
base64. -
#signing_box_get_public_key(payload, &block) ⇒ Object
INPUT: RegisteredSigningBox handle: SigningBoxHandle - # # Handle of the signing box.
-
#signing_box_sign(payload, &block) ⇒ Object
INPUT: ParamsOfSigningBoxSign signing_box: SigningBoxHandle - # # Signing Box handle.
-
#ton_crc16(payload, &block) ⇒ Object
INPUT: ParamsOfTonCrc16 data: String - # # Input data for CRC calculation.
-
#verify_signature(payload, &block) ⇒ Object
INPUT: ParamsOfVerifySignature signed: String - # # Signed data that must be verified encoded in
base64.
Methods included from CommonInstanceHelpers
#base64?, #encode_to_base64, #full_method_name
Constructor Details
#initialize(context: nil, request_id: nil, requests: nil) ⇒ Crypto
9 10 11 12 13 |
# File 'lib/everscale-client-ruby/Client/Crypto.rb', line 9 def initialize(context: nil, request_id: nil, requests: nil) @context = context @request_id = request_id @requests = requests end |
Instance Attribute Details
#context ⇒ Object (readonly)
Returns the value of attribute context.
6 7 8 |
# File 'lib/everscale-client-ruby/Client/Crypto.rb', line 6 def context @context end |
#request_id ⇒ Object (readonly)
Returns the value of attribute request_id.
6 7 8 |
# File 'lib/everscale-client-ruby/Client/Crypto.rb', line 6 def request_id @request_id end |
#requests ⇒ Object (readonly)
Returns the value of attribute requests.
6 7 8 |
# File 'lib/everscale-client-ruby/Client/Crypto.rb', line 6 def requests @requests end |
Instance Method Details
#chacha20(payload, &block) ⇒ Object
INPUT: ParamsOfChaCha20 data: String - # # Source data to be encrypted or decrypted. # # Must be encoded with base64. key: String - # # 256-bit key. # # Must be encoded with hex. nonce: String - # # 96-bit nonce. # # Must be encoded with hex. RESPONSE: ResultOfChaCha20 data: String - # # Encrypted/decrypted data. # # Encoded with base64.
316 317 318 |
# File 'lib/everscale-client-ruby/Client/Crypto.rb', line 316 def chacha20(payload, &block) TonBinding.requestLibrary(context: context, request_id: request_id, requests: requests, method_name: full_method_name(MODULE, __method__.to_s), payload: payload, &block) end |
#clear_crypto_box_secret_cache(payload, &block) ⇒ Object
INPUT: RegisteredCryptoBox handle: CryptoBoxHandle -
376 377 378 |
# File 'lib/everscale-client-ruby/Client/Crypto.rb', line 376 def clear_crypto_box_secret_cache(payload, &block) TonBinding.requestLibrary(context: context, request_id: request_id, requests: requests, method_name: full_method_name(MODULE, __method__.to_s), payload: payload, &block) end |
#convert_public_key_to_ton_safe_format(payload, &block) ⇒ Object
INPUT: ParamsOfConvertPublicKeyToTonSafeFormat public_key: String - # # Public key - 64 symbols hex string RESPONSE: ResultOfConvertPublicKeyToTonSafeFormat ton_public_key: String - # # Public key represented in TON safe format.
53 54 55 |
# File 'lib/everscale-client-ruby/Client/Crypto.rb', line 53 def convert_public_key_to_ton_safe_format(payload, &block) TonBinding.requestLibrary(context: context, request_id: request_id, requests: requests, method_name: full_method_name(MODULE, __method__.to_s), payload: payload, &block) end |
#create_crypto_box(payload, &block) ⇒ Object
INPUT: ParamsOfCreateCryptoBox secret_encryption_salt: String - # # Salt used for secret encryption. For example, a mobile device can use device ID as salt. secret: CryptoBoxSecret - # # Cryptobox secret RESPONSE: RegisteredCryptoBox handle: CryptoBoxHandle -
325 326 327 |
# File 'lib/everscale-client-ruby/Client/Crypto.rb', line 325 def create_crypto_box(payload, &block) TonBinding.requestLibrary(context: context, request_id: request_id, requests: requests, method_name: full_method_name(MODULE, __method__.to_s), payload: payload, &block) end |
#create_encryption_box(payload, &block) ⇒ Object
INPUT: ParamsOfCreateEncryptionBox algorithm: EncryptionAlgorithm - # # Encryption algorithm specifier including cipher parameters (key, IV, etc) RESPONSE: RegisteredEncryptionBox handle: EncryptionBoxHandle - # # Handle of the encryption box.
460 461 462 |
# File 'lib/everscale-client-ruby/Client/Crypto.rb', line 460 def create_encryption_box(payload, &block) TonBinding.requestLibrary(context: context, request_id: request_id, requests: requests, method_name: full_method_name(MODULE, __method__.to_s), payload: payload, &block) end |
#encryption_box_decrypt(payload, &block) ⇒ Object
INPUT: ParamsOfEncryptionBoxDecrypt encryption_box: EncryptionBoxHandle - # # Encryption box handle data: String - # # Data to be decrypted, encoded in Base64 RESPONSE: ResultOfEncryptionBoxDecrypt data: String - # # Decrypted data, encoded in Base64.
452 453 454 |
# File 'lib/everscale-client-ruby/Client/Crypto.rb', line 452 def encryption_box_decrypt(payload, &block) TonBinding.requestLibrary(context: context, request_id: request_id, requests: requests, method_name: full_method_name(MODULE, __method__.to_s), payload: payload, &block) end |
#encryption_box_encrypt(payload, &block) ⇒ Object
INPUT: ParamsOfEncryptionBoxEncrypt encryption_box: EncryptionBoxHandle - # # Encryption box handle data: String - # # Data to be encrypted, encoded in Base64 RESPONSE: ResultOfEncryptionBoxEncrypt data: String - # # Encrypted data, encoded in Base64. # # Padded to cipher block size
443 444 445 |
# File 'lib/everscale-client-ruby/Client/Crypto.rb', line 443 def encryption_box_encrypt(payload, &block) TonBinding.requestLibrary(context: context, request_id: request_id, requests: requests, method_name: full_method_name(MODULE, __method__.to_s), payload: payload, &block) end |
#encryption_box_get_info(payload, &block) ⇒ Object
INPUT: ParamsOfEncryptionBoxGetInfo encryption_box: EncryptionBoxHandle - # # Encryption box handle RESPONSE: ResultOfEncryptionBoxGetInfo info: EncryptionBoxInfo - # # Encryption box information
434 435 436 |
# File 'lib/everscale-client-ruby/Client/Crypto.rb', line 434 def encryption_box_get_info(payload, &block) TonBinding.requestLibrary(context: context, request_id: request_id, requests: requests, method_name: full_method_name(MODULE, __method__.to_s), payload: payload, &block) end |
#factorize(payload, &block) ⇒ Object
INPUT: ParamsOfFactorize composite: String - # # Hexadecimal representation of u64 composite number. RESPONSE: ResultOfFactorize factors: Array - # # Two factors of composite or empty if composite can’t be factorized.
19 20 21 |
# File 'lib/everscale-client-ruby/Client/Crypto.rb', line 19 def factorize(payload, &block) TonBinding.requestLibrary(context: context, request_id: request_id, requests: requests, method_name: full_method_name(MODULE, __method__.to_s), payload: payload, &block) end |
#generate_random_bytes(payload, &block) ⇒ Object
INPUT: ParamsOfGenerateRandomBytes length: Number - # # Size of random byte array. RESPONSE: ResultOfGenerateRandomBytes bytes: String - # # Generated bytes encoded in base64.
45 46 47 |
# File 'lib/everscale-client-ruby/Client/Crypto.rb', line 45 def generate_random_bytes(payload, &block) TonBinding.requestLibrary(context: context, request_id: request_id, requests: requests, method_name: full_method_name(MODULE, __method__.to_s), payload: payload, &block) end |
#generate_random_sign_keys(&block) ⇒ Object
RESPONSE: KeyPair public: String - # # Public key - 64 symbols hex string secret: String - # # Private key - u64 symbols hex string
60 61 62 |
# File 'lib/everscale-client-ruby/Client/Crypto.rb', line 60 def generate_random_sign_keys(&block) TonBinding.requestLibrary(context: context, request_id: request_id, requests: requests, method_name: full_method_name(MODULE, __method__.to_s), payload: {}, &block) end |
#get_crypto_box_info(payload, &block) ⇒ Object
INPUT: RegisteredCryptoBox handle: CryptoBoxHandle - RESPONSE: ResultOfGetCryptoBoxInfo encrypted_secret: String - # # Secret (seed phrase) encrypted with salt and password.
339 340 341 |
# File 'lib/everscale-client-ruby/Client/Crypto.rb', line 339 def get_crypto_box_info(payload, &block) TonBinding.requestLibrary(context: context, request_id: request_id, requests: requests, method_name: full_method_name(MODULE, __method__.to_s), payload: payload, &block) end |
#get_crypto_box_seed_phrase(payload, &block) ⇒ Object
INPUT: RegisteredCryptoBox handle: CryptoBoxHandle - RESPONSE: ResultOfGetCryptoBoxSeedPhrase phrase: String - dictionary: MnemonicDictionary - wordcount: Number -
349 350 351 |
# File 'lib/everscale-client-ruby/Client/Crypto.rb', line 349 def get_crypto_box_seed_phrase(payload, &block) TonBinding.requestLibrary(context: context, request_id: request_id, requests: requests, method_name: full_method_name(MODULE, __method__.to_s), payload: payload, &block) end |
#get_encryption_box_from_crypto_box(payload, &block) ⇒ Object
INPUT: ParamsOfGetEncryptionBoxFromCryptoBox handle: Number - # # Crypto Box Handle. hdpath: String<Optional> - # # HD key derivation path. # # By default, Everscale HD path is used. algorithm: BoxEncryptionAlgorithm - # # Encryption algorithm. secret_lifetime: Number<Optional> - # # Store derived secret for encryption algorithm for this lifetime (in ms). The timer starts after each encryption box operation. Secrets will be deleted (overwritten with zeroes) after each encryption operation, if this value is not set. RESPONSE: RegisteredEncryptionBox handle: EncryptionBoxHandle - # # Handle of the encryption box.
370 371 372 |
# File 'lib/everscale-client-ruby/Client/Crypto.rb', line 370 def get_encryption_box_from_crypto_box(payload, &block) TonBinding.requestLibrary(context: context, request_id: request_id, requests: requests, method_name: full_method_name(MODULE, __method__.to_s), payload: payload, &block) end |
#get_signing_box(payload, &block) ⇒ Object
INPUT: KeyPair public: String - # # Public key - 64 symbols hex string secret: String - # # Private key - u64 symbols hex string RESPONSE: RegisteredSigningBox handle: SigningBoxHandle - # # Handle of the signing box.
391 392 393 |
# File 'lib/everscale-client-ruby/Client/Crypto.rb', line 391 def get_signing_box(payload, &block) TonBinding.requestLibrary(context: context, request_id: request_id, requests: requests, method_name: full_method_name(MODULE, __method__.to_s), payload: payload, &block) end |
#get_signing_box_from_crypto_box(payload, &block) ⇒ Object
INPUT: ParamsOfGetSigningBoxFromCryptoBox handle: Number - # # Crypto Box Handle. hdpath: String<Optional> - # # HD key derivation path. # # By default, Everscale HD path is used. secret_lifetime: Number<Optional> - # # Store derived secret for this lifetime (in ms). The timer starts after each signing box operation. Secrets will be deleted immediately after each signing box operation, if this value is not set. RESPONSE: RegisteredSigningBox handle: SigningBoxHandle - # # Handle of the signing box.
359 360 361 |
# File 'lib/everscale-client-ruby/Client/Crypto.rb', line 359 def get_signing_box_from_crypto_box(payload, &block) TonBinding.requestLibrary(context: context, request_id: request_id, requests: requests, method_name: full_method_name(MODULE, __method__.to_s), payload: payload, &block) end |
#hdkey_derive_from_xprv(payload, &block) ⇒ Object
INPUT: ParamsOfHDKeyDeriveFromXPrv xprv: String - # # Serialized extended private key child_index: Number - # # Child index (see BIP-0032) hardened: Boolean - # # Indicates the derivation of hardened/not-hardened key (see BIP-0032) RESPONSE: ResultOfHDKeyDeriveFromXPrv xprv: String - # # Serialized extended private key
281 282 283 |
# File 'lib/everscale-client-ruby/Client/Crypto.rb', line 281 def hdkey_derive_from_xprv(payload, &block) TonBinding.requestLibrary(context: context, request_id: request_id, requests: requests, method_name: full_method_name(MODULE, __method__.to_s), payload: payload, &block) end |
#hdkey_derive_from_xprv_path(payload, &block) ⇒ Object
INPUT: ParamsOfHDKeyDeriveFromXPrvPath xprv: String - # # Serialized extended private key path: String - # # Derivation path, for instance “m/44’/396’/0’/0/0” RESPONSE: ResultOfHDKeyDeriveFromXPrvPath xprv: String - # # Derived serialized extended private key
290 291 292 |
# File 'lib/everscale-client-ruby/Client/Crypto.rb', line 290 def hdkey_derive_from_xprv_path(payload, &block) TonBinding.requestLibrary(context: context, request_id: request_id, requests: requests, method_name: full_method_name(MODULE, __method__.to_s), payload: payload, &block) end |
#hdkey_public_from_xprv(payload, &block) ⇒ Object
INPUT: ParamsOfHDKeyPublicFromXPrv xprv: String - # # Serialized extended private key RESPONSE: ResultOfHDKeyPublicFromXPrv public: String - # # Public key - 64 symbols hex string
306 307 308 |
# File 'lib/everscale-client-ruby/Client/Crypto.rb', line 306 def hdkey_public_from_xprv(payload, &block) TonBinding.requestLibrary(context: context, request_id: request_id, requests: requests, method_name: full_method_name(MODULE, __method__.to_s), payload: payload, &block) end |
#hdkey_secret_from_xprv(payload, &block) ⇒ Object
INPUT: ParamsOfHDKeySecretFromXPrv xprv: String - # # Serialized extended private key RESPONSE: ResultOfHDKeySecretFromXPrv secret: String - # # Private key - 64 symbols hex string
298 299 300 |
# File 'lib/everscale-client-ruby/Client/Crypto.rb', line 298 def hdkey_secret_from_xprv(payload, &block) TonBinding.requestLibrary(context: context, request_id: request_id, requests: requests, method_name: full_method_name(MODULE, __method__.to_s), payload: payload, &block) end |
#hdkey_xprv_from_mnemonic(payload, &block) ⇒ Object
INPUT: ParamsOfHDKeyXPrvFromMnemonic phrase: String - # # String with seed phrase dictionary: MnemonicDictionary - # # Dictionary identifier word_count: Number<Optional> - # # Mnemonic word count RESPONSE: ResultOfHDKeyXPrvFromMnemonic xprv: String - # # Serialized extended master private key
271 272 273 |
# File 'lib/everscale-client-ruby/Client/Crypto.rb', line 271 def hdkey_xprv_from_mnemonic(payload, &block) TonBinding.requestLibrary(context: context, request_id: request_id, requests: requests, method_name: full_method_name(MODULE, __method__.to_s), payload: payload, &block) end |
#mnemonic_derive_sign_keys(payload, &block) ⇒ Object
INPUT: ParamsOfMnemonicDeriveSignKeys phrase: String - # # Phrase path: String<Optional> - # # Derivation path, for instance “m/44’/396’/0’/0/0” dictionary: MnemonicDictionary - # # Dictionary identifier word_count: Number<Optional> - # # Word count RESPONSE: KeyPair public: String - # # Public key - 64 symbols hex string secret: String - # # Private key - u64 symbols hex string
261 262 263 |
# File 'lib/everscale-client-ruby/Client/Crypto.rb', line 261 def mnemonic_derive_sign_keys(payload, &block) TonBinding.requestLibrary(context: context, request_id: request_id, requests: requests, method_name: full_method_name(MODULE, __method__.to_s), payload: payload, &block) end |
#mnemonic_from_entropy(payload, &block) ⇒ Object
INPUT: ParamsOfMnemonicFromEntropy entropy: String - # # Entropy bytes. # # Hex encoded. dictionary: MnemonicDictionary - # # Dictionary identifier word_count: Number<Optional> - # # Mnemonic word count RESPONSE: ResultOfMnemonicFromEntropy phrase: String - # # Phrase
239 240 241 |
# File 'lib/everscale-client-ruby/Client/Crypto.rb', line 239 def mnemonic_from_entropy(payload, &block) TonBinding.requestLibrary(context: context, request_id: request_id, requests: requests, method_name: full_method_name(MODULE, __method__.to_s), payload: payload, &block) end |
#mnemonic_from_random(payload, &block) ⇒ Object
INPUT: ParamsOfMnemonicFromRandom dictionary: MnemonicDictionary - # # Dictionary identifier word_count: Number<Optional> - # # Mnemonic word count RESPONSE: ResultOfMnemonicFromRandom phrase: String - # # String of mnemonic words
229 230 231 |
# File 'lib/everscale-client-ruby/Client/Crypto.rb', line 229 def mnemonic_from_random(payload, &block) TonBinding.requestLibrary(context: context, request_id: request_id, requests: requests, method_name: full_method_name(MODULE, __method__.to_s), payload: payload, &block) end |
#mnemonic_verify(payload, &block) ⇒ Object
INPUT: ParamsOfMnemonicVerify phrase: String - # # Phrase dictionary: MnemonicDictionary - # # Dictionary identifier word_count: Number<Optional> - # # Word count RESPONSE: ResultOfMnemonicVerify valid: Boolean - # # Flag indicating if the mnemonic is valid or not
249 250 251 |
# File 'lib/everscale-client-ruby/Client/Crypto.rb', line 249 def mnemonic_verify(payload, &block) TonBinding.requestLibrary(context: context, request_id: request_id, requests: requests, method_name: full_method_name(MODULE, __method__.to_s), payload: payload, &block) end |
#mnemonic_words(payload, &block) ⇒ Object
INPUT: ParamsOfMnemonicWords dictionary: MnemonicDictionary - # # Dictionary identifier RESPONSE: ResultOfMnemonicWords words: String - # # The list of mnemonic words
220 221 222 |
# File 'lib/everscale-client-ruby/Client/Crypto.rb', line 220 def mnemonic_words(payload, &block) TonBinding.requestLibrary(context: context, request_id: request_id, requests: requests, method_name: full_method_name(MODULE, __method__.to_s), payload: payload, &block) end |
#modular_power(payload, &block) ⇒ Object
INPUT: ParamsOfModularPower base: String - # # base argument of calculation. exponent: String - # # exponent argument of calculation. modulus: String - # # modulus argument of calculation. RESPONSE: ResultOfModularPower modular_power: String - # # Result of modular exponentiation
29 30 31 |
# File 'lib/everscale-client-ruby/Client/Crypto.rb', line 29 def modular_power(payload, &block) TonBinding.requestLibrary(context: context, request_id: request_id, requests: requests, method_name: full_method_name(MODULE, __method__.to_s), payload: payload, &block) end |
#nacl_box(payload, &block) ⇒ Object
INPUT: ParamsOfNaclBox decrypted: String - # # Data that must be encrypted encoded in base64. nonce: String - # # Nonce, encoded in hex their_public: String - # # Receiver’s public key - unprefixed 0-padded to 64 symbols hex string secret: String - # # Sender’s private key - unprefixed 0-padded to 64 symbols hex string RESPONSE: ResultOfNaclBox encrypted: String - # # Encrypted data encoded in base64.
181 182 183 |
# File 'lib/everscale-client-ruby/Client/Crypto.rb', line 181 def nacl_box(payload, &block) TonBinding.requestLibrary(context: context, request_id: request_id, requests: requests, method_name: full_method_name(MODULE, __method__.to_s), payload: payload, &block) end |
#nacl_box_keypair(&block) ⇒ Object
RESPONSE: KeyPair public: String - # # Public key - 64 symbols hex string secret: String - # # Private key - u64 symbols hex string
161 162 163 |
# File 'lib/everscale-client-ruby/Client/Crypto.rb', line 161 def nacl_box_keypair(&block) TonBinding.requestLibrary(context: context, request_id: request_id, requests: requests, method_name: full_method_name(MODULE, __method__.to_s), payload: {}, &block) end |
#nacl_box_keypair_from_secret_key(payload, &block) ⇒ Object
INPUT: ParamsOfNaclBoxKeyPairFromSecret secret: String - # # Secret key - unprefixed 0-padded to 64 symbols hex string RESPONSE: KeyPair public: String - # # Public key - 64 symbols hex string secret: String - # # Private key - u64 symbols hex string
170 171 172 |
# File 'lib/everscale-client-ruby/Client/Crypto.rb', line 170 def nacl_box_keypair_from_secret_key(payload, &block) TonBinding.requestLibrary(context: context, request_id: request_id, requests: requests, method_name: full_method_name(MODULE, __method__.to_s), payload: payload, &block) end |
#nacl_box_open(payload, &block) ⇒ Object
INPUT: ParamsOfNaclBoxOpen encrypted: String - # # Data that must be decrypted. # # Encoded with base64. nonce: String - # # Nonce their_public: String - # # Sender’s public key - unprefixed 0-padded to 64 symbols hex string secret: String - # # Receiver’s private key - unprefixed 0-padded to 64 symbols hex string RESPONSE: ResultOfNaclBoxOpen decrypted: String - # # Decrypted data encoded in base64.
192 193 194 |
# File 'lib/everscale-client-ruby/Client/Crypto.rb', line 192 def nacl_box_open(payload, &block) TonBinding.requestLibrary(context: context, request_id: request_id, requests: requests, method_name: full_method_name(MODULE, __method__.to_s), payload: payload, &block) end |
#nacl_secret_box(payload, &block) ⇒ Object
INPUT: ParamsOfNaclSecretBox decrypted: String - # # Data that must be encrypted. # # Encoded with base64. nonce: String - # # Nonce in hex key: String - # # Secret key - unprefixed 0-padded to 64 symbols hex string RESPONSE: ResultOfNaclBox encrypted: String - # # Encrypted data encoded in base64.
202 203 204 |
# File 'lib/everscale-client-ruby/Client/Crypto.rb', line 202 def nacl_secret_box(payload, &block) TonBinding.requestLibrary(context: context, request_id: request_id, requests: requests, method_name: full_method_name(MODULE, __method__.to_s), payload: payload, &block) end |
#nacl_secret_box_open(payload, &block) ⇒ Object
INPUT: ParamsOfNaclSecretBoxOpen encrypted: String - # # Data that must be decrypted. # # Encoded with base64. nonce: String - # # Nonce in hex key: String - # # Secret key - unprefixed 0-padded to 64 symbols hex string RESPONSE: ResultOfNaclBoxOpen decrypted: String - # # Decrypted data encoded in base64.
212 213 214 |
# File 'lib/everscale-client-ruby/Client/Crypto.rb', line 212 def nacl_secret_box_open(payload, &block) TonBinding.requestLibrary(context: context, request_id: request_id, requests: requests, method_name: full_method_name(MODULE, __method__.to_s), payload: payload, &block) end |
#nacl_sign(payload, &block) ⇒ Object
INPUT: ParamsOfNaclSign unsigned: String - # # Data that must be signed encoded in base64. secret: String - # # Signer’s secret key - unprefixed 0-padded to 128 symbols hex string (concatenation of 64 symbols secret and 64 symbols public keys). See nacl_sign_keypair_from_secret_key. RESPONSE: ResultOfNaclSign signed: String - # # Signed data, encoded in base64.
126 127 128 |
# File 'lib/everscale-client-ruby/Client/Crypto.rb', line 126 def nacl_sign(payload, &block) TonBinding.requestLibrary(context: context, request_id: request_id, requests: requests, method_name: full_method_name(MODULE, __method__.to_s), payload: payload, &block) end |
#nacl_sign_detached(payload, &block) ⇒ Object
INPUT: ParamsOfNaclSign unsigned: String - # # Data that must be signed encoded in base64. secret: String - # # Signer’s secret key - unprefixed 0-padded to 128 symbols hex string (concatenation of 64 symbols secret and 64 symbols public keys). See nacl_sign_keypair_from_secret_key. RESPONSE: ResultOfNaclSignDetached signature: String - # # Signature encoded in hex.
144 145 146 |
# File 'lib/everscale-client-ruby/Client/Crypto.rb', line 144 def nacl_sign_detached(payload, &block) TonBinding.requestLibrary(context: context, request_id: request_id, requests: requests, method_name: full_method_name(MODULE, __method__.to_s), payload: payload, &block) end |
#nacl_sign_detached_verify(payload, &block) ⇒ Object
INPUT: ParamsOfNaclSignDetachedVerify unsigned: String - # # Unsigned data that must be verified. # # Encoded with base64. signature: String - # # Signature that must be verified. # # Encoded with hex. public: String - # # Signer’s public key - unprefixed 0-padded to 64 symbols hex string. RESPONSE: ResultOfNaclSignDetachedVerify succeeded: Boolean - # # true if verification succeeded or false if it failed
154 155 156 |
# File 'lib/everscale-client-ruby/Client/Crypto.rb', line 154 def nacl_sign_detached_verify(payload, &block) TonBinding.requestLibrary(context: context, request_id: request_id, requests: requests, method_name: full_method_name(MODULE, __method__.to_s), payload: payload, &block) end |
#nacl_sign_keypair_from_secret_key(payload, &block) ⇒ Object
INPUT: ParamsOfNaclSignKeyPairFromSecret secret: String - # # Secret key - unprefixed 0-padded to 64 symbols hex string RESPONSE: KeyPair public: String - # # Public key - 64 symbols hex string secret: String - # # Private key - u64 symbols hex string
117 118 119 |
# File 'lib/everscale-client-ruby/Client/Crypto.rb', line 117 def nacl_sign_keypair_from_secret_key(payload, &block) TonBinding.requestLibrary(context: context, request_id: request_id, requests: requests, method_name: full_method_name(MODULE, __method__.to_s), payload: payload, &block) end |
#nacl_sign_open(payload, &block) ⇒ Object
INPUT: ParamsOfNaclSignOpen signed: String - # # Signed data that must be unsigned. # # Encoded with base64. public: String - # # Signer’s public key - unprefixed 0-padded to 64 symbols hex string RESPONSE: ResultOfNaclSignOpen unsigned: String - # # Unsigned data, encoded in base64.
135 136 137 |
# File 'lib/everscale-client-ruby/Client/Crypto.rb', line 135 def nacl_sign_open(payload, &block) TonBinding.requestLibrary(context: context, request_id: request_id, requests: requests, method_name: full_method_name(MODULE, __method__.to_s), payload: payload, &block) end |
#register_encryption_box(&block) ⇒ Object
RESPONSE: RegisteredEncryptionBox handle: EncryptionBoxHandle - # # Handle of the encryption box.
420 421 422 |
# File 'lib/everscale-client-ruby/Client/Crypto.rb', line 420 def register_encryption_box(&block) TonBinding.requestLibrary(context: context, request_id: request_id, requests: requests, method_name: full_method_name(MODULE, __method__.to_s), payload: {}, &block) end |
#register_signing_box(&block) ⇒ Object
RESPONSE: RegisteredSigningBox handle: SigningBoxHandle - # # Handle of the signing box.
382 383 384 |
# File 'lib/everscale-client-ruby/Client/Crypto.rb', line 382 def register_signing_box(&block) TonBinding.requestLibrary(context: context, request_id: request_id, requests: requests, method_name: full_method_name(MODULE, __method__.to_s), payload: {}, &block) end |
#remove_crypto_box(payload, &block) ⇒ Object
INPUT: RegisteredCryptoBox handle: CryptoBoxHandle -
331 332 333 |
# File 'lib/everscale-client-ruby/Client/Crypto.rb', line 331 def remove_crypto_box(payload, &block) TonBinding.requestLibrary(context: context, request_id: request_id, requests: requests, method_name: full_method_name(MODULE, __method__.to_s), payload: payload, &block) end |
#remove_encryption_box(payload, &block) ⇒ Object
INPUT: RegisteredEncryptionBox handle: EncryptionBoxHandle - # # Handle of the encryption box.
426 427 428 |
# File 'lib/everscale-client-ruby/Client/Crypto.rb', line 426 def remove_encryption_box(payload, &block) TonBinding.requestLibrary(context: context, request_id: request_id, requests: requests, method_name: full_method_name(MODULE, __method__.to_s), payload: payload, &block) end |
#remove_signing_box(payload, &block) ⇒ Object
INPUT: RegisteredSigningBox handle: SigningBoxHandle - # # Handle of the signing box.
414 415 416 |
# File 'lib/everscale-client-ruby/Client/Crypto.rb', line 414 def remove_signing_box(payload, &block) TonBinding.requestLibrary(context: context, request_id: request_id, requests: requests, method_name: full_method_name(MODULE, __method__.to_s), payload: payload, &block) end |
#scrypt(payload, &block) ⇒ Object
INPUT: ParamsOfScrypt password: String - # # The password bytes to be hashed. Must be encoded with base64. salt: String - # # Salt bytes that modify the hash to protect against Rainbow table attacks. Must be encoded with base64. log_n: Number - # # CPU/memory cost parameter r: Number - # # The block size parameter, which fine-tunes sequential memory read size and performance. p: Number - # # Parallelization parameter. dk_len: Number - # # Intended output length in octets of the derived key. RESPONSE: ResultOfScrypt key: String - # # Derived key. # # Encoded with hex.
108 109 110 |
# File 'lib/everscale-client-ruby/Client/Crypto.rb', line 108 def scrypt(payload, &block) TonBinding.requestLibrary(context: context, request_id: request_id, requests: requests, method_name: full_method_name(MODULE, __method__.to_s), payload: payload, &block) end |
#sha256(payload, &block) ⇒ Object
INPUT: ParamsOfHash data: String - # # Input data for hash calculation. # # Encoded with base64. RESPONSE: ResultOfHash hash: String - # # Hash of input data. # # Encoded with ‘hex’.
87 88 89 |
# File 'lib/everscale-client-ruby/Client/Crypto.rb', line 87 def sha256(payload, &block) TonBinding.requestLibrary(context: context, request_id: request_id, requests: requests, method_name: full_method_name(MODULE, __method__.to_s), payload: payload, &block) end |
#sha512(payload, &block) ⇒ Object
INPUT: ParamsOfHash data: String - # # Input data for hash calculation. # # Encoded with base64. RESPONSE: ResultOfHash hash: String - # # Hash of input data. # # Encoded with ‘hex’.
95 96 97 |
# File 'lib/everscale-client-ruby/Client/Crypto.rb', line 95 def sha512(payload, &block) TonBinding.requestLibrary(context: context, request_id: request_id, requests: requests, method_name: full_method_name(MODULE, __method__.to_s), payload: payload, &block) end |
#sign(payload, &block) ⇒ Object
INPUT: ParamsOfSign unsigned: String - # # Data that must be signed encoded in base64. keys: KeyPair - # # Sign keys. RESPONSE: ResultOfSign signed: String - # # Signed data combined with signature encoded in base64. signature: String - # # Signature encoded in hex.
70 71 72 |
# File 'lib/everscale-client-ruby/Client/Crypto.rb', line 70 def sign(payload, &block) TonBinding.requestLibrary(context: context, request_id: request_id, requests: requests, method_name: full_method_name(MODULE, __method__.to_s), payload: payload, &block) end |
#signing_box_get_public_key(payload, &block) ⇒ Object
INPUT: RegisteredSigningBox handle: SigningBoxHandle - # # Handle of the signing box. RESPONSE: ResultOfSigningBoxGetPublicKey pubkey: String - # # Public key of signing box. # # Encoded with hex
399 400 401 |
# File 'lib/everscale-client-ruby/Client/Crypto.rb', line 399 def signing_box_get_public_key(payload, &block) TonBinding.requestLibrary(context: context, request_id: request_id, requests: requests, method_name: full_method_name(MODULE, __method__.to_s), payload: payload, &block) end |
#signing_box_sign(payload, &block) ⇒ Object
INPUT: ParamsOfSigningBoxSign signing_box: SigningBoxHandle - # # Signing Box handle. unsigned: String - # # Unsigned user data. # # Must be encoded with base64. RESPONSE: ResultOfSigningBoxSign signature: String - # # Data signature. # # Encoded with hex.
408 409 410 |
# File 'lib/everscale-client-ruby/Client/Crypto.rb', line 408 def signing_box_sign(payload, &block) TonBinding.requestLibrary(context: context, request_id: request_id, requests: requests, method_name: full_method_name(MODULE, __method__.to_s), payload: payload, &block) end |
#ton_crc16(payload, &block) ⇒ Object
INPUT: ParamsOfTonCrc16 data: String - # # Input data for CRC calculation. # # Encoded with base64. RESPONSE: ResultOfTonCrc16 crc: Number - # # Calculated CRC for input data.
37 38 39 |
# File 'lib/everscale-client-ruby/Client/Crypto.rb', line 37 def ton_crc16(payload, &block) TonBinding.requestLibrary(context: context, request_id: request_id, requests: requests, method_name: full_method_name(MODULE, __method__.to_s), payload: payload, &block) end |
#verify_signature(payload, &block) ⇒ Object
INPUT: ParamsOfVerifySignature signed: String - # # Signed data that must be verified encoded in base64. public: String - # # Signer’s public key - 64 symbols hex string RESPONSE: ResultOfVerifySignature unsigned: String - # # Unsigned data encoded in base64.
79 80 81 |
# File 'lib/everscale-client-ruby/Client/Crypto.rb', line 79 def verify_signature(payload, &block) TonBinding.requestLibrary(context: context, request_id: request_id, requests: requests, method_name: full_method_name(MODULE, __method__.to_s), payload: payload, &block) end |