Changed keyFromPrivate and keyFromPublic to accept strings, as keys can be created with hex encoded big number

This commit is contained in:
Mischa MacLeod
2019-02-04 08:54:00 +13:00
parent c214d32234
commit 62bf287f85

View File

@@ -175,8 +175,8 @@ export class ec {
constructor(options: string | curves.PresetCurve)
keyPair(options: ec.KeyPairOptions): ec.KeyPair;
keyFromPrivate(priv: Buffer | ec.KeyPair, enc?: string): ec.KeyPair;
keyFromPublic(pub: Buffer | ec.KeyPair, enc?: string): ec.KeyPair;
keyFromPrivate(priv: Buffer | string | ec.KeyPair, enc?: string): ec.KeyPair;
keyFromPublic(pub: Buffer | string | ec.KeyPair, enc?: string): ec.KeyPair;
genKeyPair(options?: ec.GenKeyPairOptions): ec.KeyPair;
sign(msg: BNInput, key: Buffer | ec.KeyPair, enc: string, options?: ec.SignOptions): ec.Signature;
sign(msg: BNInput, key: Buffer | ec.KeyPair, options?: ec.SignOptions): ec.Signature;
@@ -201,8 +201,8 @@ export namespace ec {
}
class KeyPair {
static fromPublic(ec: ec, pub: Buffer | KeyPair, enc?: string): KeyPair;
static fromPrivate(ec: ec, priv: Buffer | KeyPair, enc?: string): KeyPair;
static fromPublic(ec: ec, pub: Buffer | string | KeyPair, enc?: string): KeyPair;
static fromPrivate(ec: ec, priv: Buffer | string | KeyPair, enc?: string): KeyPair;
ec: ec;