Search code examples
javacertificatebouncycastlex509

Get certificate detail from public key?


Is there any way to get certificate detail from public key? I had to use Bouncy Castle jar for this but somehow I can't solve this problem.


Solution

  • You can use the openssl toolkit to inspect certificates:

    $ openssl x509 -in /usr/share/ca-certificates/cacert.org/cacert.org.crt -text
    Certificate:
        Data:
            Version: 3 (0x2)
            Serial Number: 0 (0x0)
            Signature Algorithm: md5WithRSAEncryption
    ...
    

    If you need the results in another environment, you may need to give more details.