我爱占星网 我爱占星网
首页
编程
java
php
前端
首页 编程 java php 前端

如何使用Go Golang签署文件

If I generate my key with openssl like this:

openssl req -x509 -sha256 -nodes -days 365 -newkey rsa:2048 -keyout testsign.key -out testsign.crt

What Go or Golang library or method or tool can I use to sign a file with that key?

To satisfy the requirements I needed to accomplish with Go & OpenSSL, it's as straight forward as executing command line:

    c := "openssl"
    a := []string{"dgst", "-sha512", "-sign", "signature.key", "-out", "FileOut.signed", "FileToBeSigned.txt"}   
    cmd := exec.Command(c, a...)

近期文章

  • AWS CodeBuild golang构建失败
  • 如何使用Go Mod供应商从GOPATH复制Deps?
  • 在函数中更改全局切片
  • 使用动态细分构建休假请求
  • 通过Cgo访问Aerospike C客户端时出错
  • 如何测试从AWS开发工具包找不到的结果?
  • 如何查看对在Heroku local中运行的Go应用程序所做的更改?
  • 无法通过负载均衡器传递查询IP
  • 命令'go install ckage'失败,退出代码为1
  • Golang管道SetReadDeadline首次读取后失败
  • 尝试将视频上传到youtube API时发生408超时错误
  • 如何在Golang中使用REST Api从第三方获取数据
  • Hyperledger Fabric使用Go SDK将交易存储在CouchDB中
  • [] struct {}和[] * struct {}有什么区别?
  • 上交所未注册
  • 无法安装Revel框架表格Go
  • 如何使用docker go-lang API的TaskLogs端点?
  • 进行例行泄漏修复
  • Golang中变量的范围
  • 需要将数据添加到CSV而不向数据添加逗号

Copyright ©2022 我爱占星 All Rights Reserved.

浙ICP备2022030071号-1

部分图文来自网络,如有侵犯您的版权,请告诉我们删除

友情链接:代码精华