请选择 进入手机版 | 继续访问电脑版

golang调用java——secp256k1

[复制链接]
发表于 2019-10-15 15:44:40 |显示全部楼层
用idea生成一个jar文件Verify.jar,能在命令行中成功运行


java -jar Verify[color=rgb(0, 153, 0) !important].jar 参数[color=rgb(0, 102, 102) !important]1 参数[color=rgb(0, 102, 102) !important]2 参数[color=rgb(0, 102, 102) !important]3


package main

import (
    "fmt"
    "os/exec"
)

const (
    sigScript  string = "3046022100E4C617A5626E408938EEAC33D7BC0ACD645D8FF0B9A29FE55EC3F9BAB01A07C9022100D0F9E8A545E997F3E431C5E3DADA0EC5F53ACE6A7E9598FD6F3B85BE055D3E10"
    unsignedTx string = "bqh"
    pubScr     string = "MFYwEAYHKoZIzj0CAQYFK4EEAAoDQgAEnpwnu94soZ/z9QdfTEwJAY+Qhz34pLsNFZA/OgmhekTIBBdJyxpHs4GaId3wWrq11OyqmJlu2qCLDtZcGFBjdA=="
    priScr     string = "MIGNAgEAMBAGByqGSM49AgEGBSuBBAAKBHYwdAIBAQQg49U3dRtNk+WZ6E1BJKIM8oHP2zm766HFTF9jjP1RM9qgBwYFK4EEAAqhRANCAASwYY8XyIPfiNnfkC25axj/Lw6Eq64hVaz34PKquSwiujCk3tB21VivJwrUJkXhkCmAxYsYhF6izcNLpOAvDrPO"
)

func main() {
    cmd := exec.Command("java", "-jar", "Verify.jar", pubScr, unsignedTx, sigScript)
    out, err := cmd.Output()
    if err != nil {
        fmt.Println(err)
    }
    fmt.Print(string(out))
}


您需要登录后才可以回帖 登录 | 立即注册

Archiver|手机版|沙漏笔记

GMT+8, 2019-12-16 21:16 , Processed in 0.106358 second(s), 20 queries .

Powered by Discuz! X2.5

© 2001-2012 Comsenz Inc.

Copyright © 2015-2018 xuejava网 / 鲁ICP备17054568号-1
回顶部