openssl extract public key from certificate

The certificate files we obtain all contain the public key of the other party. After verifying the validity of the certificate, we can extract the public key of the certificate for subsequent secure communication.

The client extracts the public key of the server certificate:

openssl x509 -in client.crt -pubkey -noout > client.key

operation result:
insert image description here

The server extracts the public key of the client certificate:

openssl x509 -in server.crt -pubkey -noout > server.key

operation result:
insert image description here

Reference: openssl extracts public key from certificate

Guess you like

Origin blog.csdn.net/weixin_42098322/article/details/125480771