Fix various keys issues (#117)

* Fix armouring headers for public keys
* Fix error for session key decryption failure
This commit is contained in:
wussler 2021-03-09 19:06:35 +01:00 committed by GitHub
parent 27efcb4627
commit ff54225384
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
7 changed files with 75 additions and 6 deletions

View file

@ -200,7 +200,11 @@ func (key *Key) Armor() (string, error) {
return "", err
}
return armor.ArmorWithType(serialized, constants.PrivateKeyHeader)
if key.IsPrivate() {
return armor.ArmorWithType(serialized, constants.PrivateKeyHeader)
}
return armor.ArmorWithType(serialized, constants.PublicKeyHeader)
}
// ArmorWithCustomHeaders returns the armored key as a string, with