However the following command did the strange things: openssl x509 -in cert.pem -pubkey -noout -out pubkey.pem
It ignored the "-out pubkey" and printed the public key to STDOUT.
Also, the -pubkey option hasn't been listed in the list of options of
x509 command (http://www.openssl.org/docs/apps/x509.html#). Maybe it
corresponds to the latest openssl v.0.9.8, but that option hasn't been
listed also in "man page" for openssl v.0.9.7a.