(ctx context.Context)
| 97 | } |
| 98 | |
| 99 | func getUsername(ctx context.Context) string { |
| 100 | user, ok := ctx.Value(conf.UserKey).(*model.User) |
| 101 | if !ok { |
| 102 | return "<system>" |
| 103 | } |
| 104 | return user.Username |
| 105 | } |
| 106 | |
| 107 | func loadPrivateKey(key, passphrase string) (*openpgp.Entity, error) { |
| 108 | entityList, err := openpgp.ReadArmoredKeyRing(strings.NewReader(key)) |