Iva*_*sov 5 javascript azure azure-keyvault tron tronweb
我正在考虑在 Azure 上为我的 erc-20 令牌开发 Tron 和以太坊链之间的桥梁,并将我的私钥存储在 Azure 密钥保管库中。对于以太坊,我找到了一个很好的库:https: //github.com/tmarkovski/ethereumjs-tx-keyvault,但是同样的方法可以在 tronweb 中使用吗?tronweb 使用 elliptic.js 进行签名:
export function ECKeySign(hashBytes, priKeyBytes) {
const ec = new EC("secp256k1");
const key = ec.keyFromPrivate(priKeyBytes, "bytes");
const signature = key.sign(hashBytes);
const r = signature.r;
const s = signature.s;
const id = signature.recoveryParam;
let rHex = r.toString("hex");
while (rHex.length < 64) {
rHex = `0${rHex}`;
}
let sHex = s.toString("hex");
while (sHex.length < 64) {
sHex = `0${sHex}`;
}
const idHex = byte2hexStr(id);
const signHex = rHex + sHex + idHex;
return signHex;
}
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
385 次 |
| 最近记录: |