gpgSign produces an ASCII-armored detached signature over payload using the test key.
(t *testing.T, payload []byte)
| 298 | // gpgSign produces an ASCII-armored detached signature over payload using |
| 299 | // the test key. |
| 300 | func gpgSign(t *testing.T, payload []byte) string { |
| 301 | t.Helper() |
| 302 | cmd := exec.Command("gpg", |
| 303 | "--batch", "--pinentry-mode", "loopback", "--passphrase", "", |
| 304 | "--armor", "--detach-sign", "--local-user", gpg.keyID) |
| 305 | cmd.Stdin = bytes.NewReader(payload) |
| 306 | var stderr bytes.Buffer |
| 307 | cmd.Stderr = &stderr |
| 308 | out, err := cmd.Output() |
| 309 | require.NoErrorf(t, err, "gpg --detach-sign: %s", stderr.String()) |
| 310 | return string(out) |
| 311 | } |
| 312 | |
| 313 | func initRepo(t *testing.T) string { |
| 314 | t.Helper() |
no test coverage detected
searching dependent graphs…