diff options
author | Michael Muré <batolettre@gmail.com> | 2022-02-15 21:35:49 +0100 |
---|---|---|
committer | Michael Muré <batolettre@gmail.com> | 2022-02-15 21:35:49 +0100 |
commit | 44f61b66775e77fd8b42ba3ea57b2c323463b725 (patch) | |
tree | 8d611d4df0112c7ff20b6b834283fb459dd6e3d1 /identity/key.go | |
parent | 9ed515fd546a6ed5e82b2b87d12f0241727d3f89 (diff) | |
download | git-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.go | 16 |
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 }(), + }, + }, + }, } } |