Communities

Writing
Writing
Codidact Meta
Codidact Meta
The Great Outdoors
The Great Outdoors
Photography & Video
Photography & Video
Scientific Speculation
Scientific Speculation
Cooking
Cooking
Electrical Engineering
Electrical Engineering
Judaism
Judaism
Languages & Linguistics
Languages & Linguistics
Software Development
Software Development
Mathematics
Mathematics
Christianity
Christianity
Code Golf
Code Golf
Music
Music
Physics
Physics
Linux Systems
Linux Systems
Power Users
Power Users
Tabletop RPGs
Tabletop RPGs
Community Proposals
Community Proposals
tag:snake search within a tag
answers:0 unanswered questions
user:xxxx search by author id
score:0.5 posts with 0.5+ score
"snake oil" exact phrase
votes:4 posts with 4+ votes
created:<1w created < 1 week ago
post_type:xxxx type of post
Search help
Notifications
Mark all as read See all your notifications »
Q&A

Post History

57%
+2 −1
Q&A How to view a TLS certificate from the command line?

I have a TLS certificate, let's say codidact.pem (downloaded as in https://linux.codidact.com/posts/292251/292257#answer-292257). But when I view it the file it appears to be base64 encoded: $ cat...

2 answers  ·  posted 3mo ago by matthewsnyder‭  ·  edited 3mo ago by matthewsnyder‭

Question cli tls
#2: Post edited by user avatar matthewsnyder‭ · 2024-08-14T17:55:53Z (3 months ago)
added example
  • I have a TLS certificate, let's say `server.crt`, but when I view it as text it appears to be base64 encoded with `BEGIN CERTIFICATE` lines.
  • How can I see the contents of the certificate, from the command line?
  • I have a TLS certificate, let's say `codidact.pem` (downloaded as in https://linux.codidact.com/posts/292251/292257#answer-292257)[](). But when I view it the file it appears to be base64 encoded:
  • ```
  • $ cat codidact.pem
  • -----BEGIN CERTIFICATE-----
  • MIIDqDCCA06gAwIBAgIQFUeE1XIvh5MNywyN4cuLUTAKBggqhkjOPQQDAjA7MQsw
  • CQYDVQQGEwJVUzEeMBwGA1UEChMVR29vZ2xlIFRydXN0IFNlcnZpY2VzMQwwCgYD
  • VQQDEwNXRTEwHhcNMjQwNzE5MjI1NzQ0WhcNMjQxMDE3MjI1NzQzWjAXMRUwEwYD
  • VQQDEwxjb2RpZGFjdC5jb20wWTATBgcqhkjOPQIBBggqhkjOPQMBBwNCAATPSLUR
  • GJEdUQgOV/55h9+55cU6EoIBSO0v2ud3tVsDIFd2G02PgdmGeT9jEtHNYFEExhyl
  • 9QXOGhZbKACKP/sGo4ICVjCCAlIwDgYDVR0PAQH/BAQDAgeAMBMGA1UdJQQMMAoG
  • CCsGAQUFBwMBMAwGA1UdEwEB/wQCMAAwHQYDVR0OBBYEFJCOyNG3GnEEITEdClgY
  • OveIurSQMB8GA1UdIwQYMBaAFJB3kjVnxP+ozKnme9mAeXvMk/k4MF4GCCsGAQUF
  • BwEBBFIwUDAnBggrBgEFBQcwAYYbaHR0cDovL28ucGtpLmdvb2cvcy93ZTEvRlVj
  • MCUGCCsGAQUFBzAChhlodHRwOi8vaS5wa2kuZ29vZy93ZTEuY3J0MCcGA1UdEQQg
  • MB6CDGNvZGlkYWN0LmNvbYIOKi5jb2RpZGFjdC5jb20wEwYDVR0gBAwwCjAIBgZn
  • gQwBAgEwNgYDVR0fBC8wLTAroCmgJ4YlaHR0cDovL2MucGtpLmdvb2cvd2UxL2M5
  • ZWdZOWlrUHNVLmNybDCCAQUGCisGAQQB1nkCBAIEgfYEgfMA8QB2ANq2v2s/tbYi
  • n5vCu1xr6HCRcWy7UYSFNL2kPTBI1/urAAABkM1uH3UAAAQDAEcwRQIgAr7iugfA
  • kjExK2ZcRyUNlfOT2PXUYj7CqBa3G64+IuYCIQCW3Rjsm7v57IWdNWPncgUutHqj
  • L22VjyVlLF1DSYLFhQB3AO7N0GTV2xrOxVy3nbTNE6Iyh0Z8vOzew1FIWUZxH7Wb
  • AAABkM1uHzgAAAQDAEgwRgIhAI27YgHLST7sAa46XvUxGt1HO03nyy5CjnHSUAEc
  • SJugAiEAzs6An9NyXMV3ktidEysoRl/o9oDSMwEVhjNwI79+JfAwCgYIKoZIzj0E
  • AwIDSAAwRQIgBohJMzekzkYdS9X9eopTUEpBpmMMOiGc7+6hT6D1CisCIQDEiuPA
  • z6+KeqCZnRIy+X4J0n0qI914lCLkEDytyAJWaA==
  • -----END CERTIFICATE-----
  • ```
  • How can I see the contents of the certificate, from the command line?
#1: Initial revision by user avatar matthewsnyder‭ · 2024-08-13T16:21:44Z (3 months ago)
How to view a TLS certificate from the command line?
I have a TLS certificate, let's say `server.crt`, but when I view it as text it appears to be base64 encoded with `BEGIN CERTIFICATE` lines.

How can I see the contents of the certificate, from the command line?