Remove unused code + handle errors

This commit is contained in:
William Gotti 2019-05-13 12:42:29 +00:00 committed by Daniel Huigens
parent e797299d64
commit b820c14c1a
7 changed files with 26 additions and 12 deletions

View file

@ -527,6 +527,9 @@ func (pm *PmCrypto) BuildKeyRingNoError(binKeys []byte) (kr *KeyRing) {
// BuildKeyRingArmored reads armored string and returns keyring
func (pm *PmCrypto) BuildKeyRingArmored(key string) (kr *KeyRing, err error) {
keyRaw, err := armorUtils.Unarmor(key)
if err != nil {
return nil, err
}
keyReader := bytes.NewReader(keyRaw)
keyEntries, err := openpgp.ReadKeyRing(keyReader)
return &KeyRing{entities: keyEntries}, err