diff --git a/openpgp/decrypt.go b/openpgp/decrypt.go index f756f58..78b24aa 100644 --- a/openpgp/decrypt.go +++ b/openpgp/decrypt.go @@ -68,7 +68,7 @@ func (o *FastOpenPGP) decrypt(reader io.Reader, privateKey, passphrase string, s return nil, fmt.Errorf("signature error: %w", md.SignatureError) } - if md.SignedBy == nil { + if !md.IsSigned { return nil, errors.New("message is not signed") } diff --git a/openpgp/verify.go b/openpgp/verify.go index cdf32ef..6d7870c 100644 --- a/openpgp/verify.go +++ b/openpgp/verify.go @@ -86,7 +86,7 @@ func (o *FastOpenPGP) verifyDataBytes(signedData io.Reader, publicKey string, sh return false, fmt.Errorf("invalid read message: %w", err) } - if md.SignedBy == nil { + if !md.IsSigned { return false, errors.New("message was not signed") }