(c *C, decrypt bool)
| 706 | } |
| 707 | |
| 708 | func commitSignKey(c *C, decrypt bool) *openpgp.Entity { |
| 709 | s := strings.NewReader(armoredKeyRing) |
| 710 | es, err := openpgp.ReadArmoredKeyRing(s) |
| 711 | c.Assert(err, IsNil) |
| 712 | |
| 713 | c.Assert(es, HasLen, 1) |
| 714 | c.Assert(es[0].Identities, HasLen, 1) |
| 715 | _, ok := es[0].Identities["foo bar <foo@foo.foo>"] |
| 716 | c.Assert(ok, Equals, true) |
| 717 | |
| 718 | key := es[0] |
| 719 | if decrypt { |
| 720 | err = key.PrivateKey.Decrypt([]byte(keyPassphrase)) |
| 721 | c.Assert(err, IsNil) |
| 722 | } |
| 723 | |
| 724 | return key |
| 725 | } |
| 726 | |
| 727 | const armoredKeyRing = ` |
| 728 | -----BEGIN PGP PRIVATE KEY BLOCK----- |
no outgoing calls
no test coverage detected
searching dependent graphs…