(c *C, decrypt bool)
| 541 | } |
| 542 | |
| 543 | func commitSignKey(c *C, decrypt bool) *openpgp.Entity { |
| 544 | s := strings.NewReader(armoredKeyRing) |
| 545 | es, err := openpgp.ReadArmoredKeyRing(s) |
| 546 | c.Assert(err, IsNil) |
| 547 | |
| 548 | c.Assert(es, HasLen, 1) |
| 549 | c.Assert(es[0].Identities, HasLen, 1) |
| 550 | _, ok := es[0].Identities["foo bar <foo@foo.foo>"] |
| 551 | c.Assert(ok, Equals, true) |
| 552 | |
| 553 | key := es[0] |
| 554 | if decrypt { |
| 555 | err = key.PrivateKey.Decrypt([]byte(keyPassphrase)) |
| 556 | c.Assert(err, IsNil) |
| 557 | } |
| 558 | |
| 559 | return key |
| 560 | } |
| 561 | |
| 562 | const armoredKeyRing = ` |
| 563 | -----BEGIN PGP PRIVATE KEY BLOCK----- |
no outgoing calls
no test coverage detected