如果我使用openssl生成密钥,如下所示:
openssl req -x509 -sha256 -nodes -days 365 -newkey rsa:2048 -keyout testsign.key -out testsign.crt
我可以使用哪种Go或Golang库或方法或工具来用该密钥签名文件?
答案 0 :(得分:0)
要满足我使用Go&OpenSSL所需完成的要求,它与执行命令行一样直接:
c := "openssl"
a := []string{"dgst", "-sha512", "-sign", "signature.key", "-out", "FileOut.signed", "FileToBeSigned.txt"}
cmd := exec.Command(c, a...)