Class: MoneyTree::Key
Direct Known Subclasses
Defined Under Namespace
Classes: InvalidBase64Format, InvalidWIFFormat, KeyFormatNotFound, KeyGenerationFailure, KeyImportFailure, KeyInvalid
Constant Summary collapse
- GROUP_NAME =
"secp256k1"
- ORDER =
"fffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd0364141".to_i(16)
Constants included from Support
Support::BASE58_CHARS, Support::INT32_MAX, Support::INT64_MAX
Instance Attribute Summary collapse
-
#ec_key ⇒ Object
Returns the value of attribute ec_key.
-
#key ⇒ Object
readonly
Returns the value of attribute key.
-
#options ⇒ Object
readonly
Returns the value of attribute options.
-
#raw_key ⇒ Object
readonly
Returns the value of attribute raw_key.
Instance Method Summary collapse
Methods included from Support
#base58_to_int, #bytes_to_hex, #bytes_to_int, #convert_p2wpkh_p2sh, #custom_hash_160, #decode_base58, #decode_base64, #digestify, #encode_base58, #encode_base64, #encode_p2wpkh_p2sh, #from_serialized_base58, #hex_to_bytes, #hex_to_int, #hmac_sha512, #hmac_sha512_hex, #int_to_base58, #int_to_bytes, #int_to_hex, #ripemd160, #sha256, #to_serialized_base58, #to_serialized_bech32
Instance Attribute Details
#ec_key ⇒ Object
Returns the value of attribute ec_key.
20 21 22 |
# File 'lib/money-tree/key.rb', line 20 def ec_key @ec_key end |
#key ⇒ Object (readonly)
Returns the value of attribute key.
17 18 19 |
# File 'lib/money-tree/key.rb', line 17 def key @key end |
#options ⇒ Object (readonly)
Returns the value of attribute options.
16 17 18 |
# File 'lib/money-tree/key.rb', line 16 def @options end |
#raw_key ⇒ Object (readonly)
Returns the value of attribute raw_key.
18 19 20 |
# File 'lib/money-tree/key.rb', line 18 def raw_key @raw_key end |
Instance Method Details
#to_bytes ⇒ Object
30 31 32 |
# File 'lib/money-tree/key.rb', line 30 def to_bytes hex_to_bytes to_hex end |
#to_i ⇒ Object
34 35 36 |
# File 'lib/money-tree/key.rb', line 34 def to_i bytes_to_int to_bytes end |
#valid?(eckey = nil) ⇒ Boolean
25 26 27 28 |
# File 'lib/money-tree/key.rb', line 25 def valid?(eckey = nil) eckey ||= ec_key eckey.nil? ? false : eckey.check_key end |