Skip to content
This repository has been archived by the owner on Aug 2, 2022. It is now read-only.

eosjs-ecc methods and migration (release/21.0.x branch) #709

Merged
merged 12 commits into from
Apr 1, 2020

Conversation

bradlhart
Copy link
Contributor

Change Description

Following feedback and requests, the ecc helper functions have been renamed to match the eosjs-ecc methods where possible. A private key generation method has also been added, as well as a PublicKey.toLegacyString() method for backwards compatibility.

Lastly, an ecc exported object is available with all the functions eosjs-ecc has that utilizes the new functions.

Second PR to cherry pick commits to release/21.0.x branch

API Changes

  • API Changes

Changed:
sign, verify, and recover now have the argument shouldHash that by default is set to true. These functions will hash the data given but can accept already hashed data with shouldHash = false
PublicKey.validate was renamed to PublicKey.isValid
Signature.recoverPublicKey was renamed to Signature.recover

New:
PrivateKey.toLegacyString: Convert private key to Legacy EOSIO-format private key
PrivateKey.isValid: Validate a private key
PublicKey.toLegacyString: Convert public key to Legacy EOSIO-format public key
generateKeyPair: Utilizes the elliptic package to generate a public and private key pair. This function should only be used in secure environments and requires an environment variable to be set to confirm that the environment is secure.
sha256: An exported sha256 function from the elliptic package

Documentation Additions

  • Documentation Additions

@bradlhart bradlhart merged commit 14ff1ca into release/21.0.x Apr 1, 2020
@bradlhart bradlhart deleted the ecc-additional-helpers branch April 1, 2020 19:27
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants