openssl x509 -in certificate.pem -pubkey -noout openssl pkey -pubin -outform der openssl…
- User
openssl x509 -in certificate.pem -pubkey -noout | openssl pkey -pubin -outform der | openssl dgst -sha256 -binary | openssl enc -base64 doesn't work. Does xray require special hash format?
- Assistant
The command you've provided is meant to extract the public key from a certificate, hash it using SHA-256, and then encode the hash in Base64. This series of commands is typically used to generate a hash of the public key that might be required for specific applications or configurations, like pinning a certificate in some software.
If this command isn't working as expected, there are several things to check and consider:
-
Ensure the Certificate is Correct: Verify that
certificate.pemis indeed the correct file and contains a valid certificate.
-