aboutsummaryrefslogtreecommitdiffstats
path: root/identity/key.go
diff options
context:
space:
mode:
authorMichael Muré <batolettre@gmail.com>2022-02-15 21:35:49 +0100
committerMichael Muré <batolettre@gmail.com>2022-02-15 21:35:49 +0100
commit44f61b66775e77fd8b42ba3ea57b2c323463b725 (patch)
tree8d611d4df0112c7ff20b6b834283fb459dd6e3d1 /identity/key.go
parent9ed515fd546a6ed5e82b2b87d12f0241727d3f89 (diff)
downloadgit-bug-44f61b66775e77fd8b42ba3ea57b2c323463b725.tar.gz
update keyring and migrate to github.com/ProtonMail/go-crypto
Diffstat (limited to 'identity/key.go')
-rw-r--r--identity/key.go16
1 files changed, 13 insertions, 3 deletions
diff --git a/identity/key.go b/identity/key.go
index daa66b0e..82b9b95c 100644
--- a/identity/key.go
+++ b/identity/key.go
@@ -8,10 +8,10 @@ import (
"strings"
"time"
+ "github.com/ProtonMail/go-crypto/openpgp"
+ "github.com/ProtonMail/go-crypto/openpgp/armor"
+ "github.com/ProtonMail/go-crypto/openpgp/packet"
"github.com/pkg/errors"
- "golang.org/x/crypto/openpgp"
- "golang.org/x/crypto/openpgp/armor"
- "golang.org/x/crypto/openpgp/packet"
"github.com/MichaelMure/git-bug/repository"
)
@@ -217,8 +217,18 @@ func (k *Key) storePrivate(repo repository.RepoKeyring) error {
}
func (k *Key) PGPEntity() *openpgp.Entity {
+ uid := packet.NewUserId("", "", "")
return &openpgp.Entity{
PrimaryKey: k.public,
PrivateKey: k.private,
+ Identities: map[string]*openpgp.Identity{
+ uid.Id: {
+ Name: uid.Id,
+ UserId: uid,
+ SelfSignature: &packet.Signature{
+ IsPrimaryId: func() *bool { b := true; return &b }(),
+ },
+ },
+ },
}
}