'How can extract public key from signature with openssl?

We can extract public key from certificate:

openssl x509  -in  some_certificate.crt  -pubkey -noout  > pub.pem

Also extract signature from certificate:

openssl x509 -in some_certificate.crt -text -noout      \  
             -certopt ca_default -certopt no_validity   \
             -certopt no_serial -certopt no_subject     \
             -certopt no_extensions -certopt no_signame >  test.sig

If i remove some_certificate.crt,is there a way to extract public key from test.sig?As i know that signature file signed with gpg contain keyid,we can get public key then:

gpg  --list-packets  some_package_signed_with_gpg.asc
keyid xxxxxxxxx
gpg --keyserver keyserver.ubuntu.com --recv xxxxxxxxx
gpg --export --armor xxxxxxxxx


Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source