floCrypto v2.3.6b
- floCrypto.signData to throw error when privateKey not passed
This commit is contained in:
parent
07a6d6b4d6
commit
4e13fe2a0e
@ -1,4 +1,4 @@
|
|||||||
(function (EXPORTS) { //floCrypto v2.3.6a
|
(function (EXPORTS) { //floCrypto v2.3.6b
|
||||||
/* FLO Crypto Operators */
|
/* FLO Crypto Operators */
|
||||||
'use strict';
|
'use strict';
|
||||||
const floCrypto = EXPORTS;
|
const floCrypto = EXPORTS;
|
||||||
@ -121,6 +121,7 @@
|
|||||||
|
|
||||||
//Sign data using private-key
|
//Sign data using private-key
|
||||||
floCrypto.signData = function (data, privateKeyHex) {
|
floCrypto.signData = function (data, privateKeyHex) {
|
||||||
|
if (typeof privateKeyHex !== "string") throw new Error("No private key found.");
|
||||||
var key = new Bitcoin.ECKey(privateKeyHex);
|
var key = new Bitcoin.ECKey(privateKeyHex);
|
||||||
var messageHash = Crypto.SHA256(data);
|
var messageHash = Crypto.SHA256(data);
|
||||||
var messageSign = Bitcoin.ECDSA.sign(messageHash, key.priv);
|
var messageSign = Bitcoin.ECDSA.sign(messageHash, key.priv);
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user