I was given a certificate and tried to extract public key out of it.
My certificate is like
-----BEGIN CERTIFICATE-----
SNFMFGFDGIIG ....
-----END CERTIFICATE-----
and I saved it as test.cer
.
I have looked up online and tried to extract public key.
I tried:
openssl x509 -inform pem -in test.cer -pubkey -noout > publickey.pem
but I am getting
unable to load certificate
56091:error:0906D06C:PEM routines:PEM_read_bio:no start line:/BuildRoot/Library/Caches/com.apple.xbs/Sources/OpenSSL098/OpenSSL098-59.60.1/src/crypto/pem/pem_lib.c:648:Expecting: TRUSTED CERTIFICATE
I am not that familiar with the process and was hoping someone here can help me out. Thanks so much!