Convert private to public keys in helpers to prevent locked errors (#66)
This commit is contained in:
parent
979fdb3f4b
commit
b152448673
3 changed files with 37 additions and 7 deletions
|
|
@ -21,6 +21,12 @@ func EncryptSignAttachment(
|
|||
if publicKeyObj, err = crypto.NewKeyFromArmored(publicKey); err != nil {
|
||||
return nil, nil, nil, err
|
||||
}
|
||||
if publicKeyObj.IsPrivate() {
|
||||
publicKeyObj, err = publicKeyObj.ToPublic()
|
||||
if err != nil {
|
||||
return nil, nil, nil, err
|
||||
}
|
||||
}
|
||||
|
||||
if publicKeyRing, err = crypto.NewKeyRing(publicKeyObj); err != nil {
|
||||
return nil, nil, nil, err
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue