Skip to main content

OpenSSL command to parse certificate

OpenSSL command to parse certificate

In this post, we will learn about openSSL command that used to parse pem certificate on Ubuntu operating system.
Save below SSL certificate in a file with name cert.pem
 -----BEGIN CERTIFICATE-----  
 MIIHxzCCBq+gAwIBAgIIVQ0A1nm/F3swDQYJKoZIhvcNAQELBQAwVDELMAkGA1UE  
 BhMCVVMxHjAcBgNVBAoTFUdvb2dsZSBUcnVzdCBTZXJ2aWNlczElMCMGA1UEAxMc  
 R29vZ2xlIEludGVybmV0IEF1dGhvcml0eSBHMzAeFw0xODExMjcxNDAyMDBaFw0x  
 OTAyMTkxNDAyMDBaMGYxCzAJBgNVBAYTAlVTMRMwEQYDVQQIDApDYWxpZm9ybmlh  
 MRYwFAYDVQQHDA1Nb3VudGFpbiBWaWV3MRMwEQYDVQQKDApHb29nbGUgTExDMRUw  
 EwYDVQQDDAwqLmdvb2dsZS5jb20wWTATBgcqhkjOPQIBBggqhkjOPQMBBwNCAAQh  
 4dvV+L1osQ7c2x8LgsuHE09NqB4H7nO5MmSul1Bda56d6C7IrqBumitdrYm0ybWR  
 WtTjpYA9cYeH1w/EmBECo4IFVDCCBVAwEwYDVR0lBAwwCgYIKwYBBQUHAwEwDgYD  
 VR0PAQH/BAQDAgeAMIIEGQYDVR0RBIIEEDCCBAyCDCouZ29vZ2xlLmNvbYINKi5h  
 bmRyb2lkLmNvbYIWKi5hcHBlbmdpbmUuZ29vZ2xlLmNvbYISKi5jbG91ZC5nb29n  
 bGUuY29tggYqLmcuY2+CDiouZ2NwLmd2dDIuY29tggoqLmdncGh0LmNughYqLmdv  
 b2dsZS1hbmFseXRpY3MuY29tggsqLmdvb2dsZS5jYYILKi5nb29nbGUuY2yCDiou  
 Z29vZ2xlLmNvLmlugg4qLmdvb2dsZS5jby5qcIIOKi5nb29nbGUuY28udWuCDyou  
 Z29vZ2xlLmNvbS5hcoIPKi5nb29nbGUuY29tLmF1gg8qLmdvb2dsZS5jb20uYnKC  
 DyouZ29vZ2xlLmNvbS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wWjAtBggrBgEFBQcwAoYhaHR0cDovL3Br  
 aS5nb29nL2dzcjIvR1RTR0lBRzMuY3J0MCkGCCsGAQUFBzABhh1odHRwOi8vb2Nz  
 cC5wa2kuZ29vZy9HVFNHSUFHMzAdBgNVHQ4EFgQUbXkS/UoFxQ478CmEhFGuELv9  
 wCwwDAYDVR0TAQH/BAIwADAfBgNVHSMEGDAWgBR3wrhQmmd2drEtwobQg6B+pn66  
 SzAhBgNVHSAEGjAYMAwGCisGAQQB1nkCBQMwCAYGZ4EMAQICMDEGA1UdHwQqMCgw  
 JqAkoCKGIGh0dHA6Ly9jcmwucGtpLmdvb2cvR1RTR0lBRzMuY3JsMA0GCSqGSIb3  
 DQEBCwUAA4IBAQBGWxDUuGST/mFAv1xeJL7IJVyXsjtyIaPyQZaavVq+/eVS9Iek  
 ix6pJQ+AkibFvP2fKq9JxrktFdvsHJMAN9x0R4YXa0GkcUzhkTEHrX+gQ4oeRPmH  
 83aZH3CAz2Mv4siB8n3dIBwxrOAcBje/KlvGDmqF08Yy6twlRt7LwcVA84ebxkXg  
 Igc8VsIzwBRrJDGFTfM4sIm66+KErwWyMqfNnr7KMZTJp9AU/B3I9AT7AbC5aWZ1  
 itOu154IppIV4cXAU5/7wK96kosDGmIbiBnVKUraEfKRUm0pNG8EA6Lv7uDGJOje  
 Wcw8Po0wM93wTFkOW3MiVYGIQ6lg8Pef4Ljy  
 -----END CERTIFICATE-----  
Parse above SSL certificate with below OpenSSL command
 openssl x509 -in gcert.pem -text -noout  
Above command will parse SSL certificate and return below output
 Certificate:  
   Data:  
     Version: 3 (0x2)  
     Serial Number: 6128555589086680955 (0x550d00d679bf177b)  
   Signature Algorithm: sha256WithRSAEncryption  
     Issuer: C=US, O=Google Trust Services, CN=Google Internet Authority G3  
     Validity  
       Not Before: Nov 27 14:02:00 2018 GMT  
       Not After : Feb 19 14:02:00 2019 GMT  
     Subject: C=US, ST=California, L=Mountain View, O=Google LLC, CN=*.google.com  
     Subject Public Key Info:  
       Public Key Algorithm: id-ecPublicKey  
         Public-Key: (256 bit)  
         pub:   
           04:21:e1:db:d5:f8:bd:68:b1:0e:dc:db:1f:0b:82:  
           cb:87:13:4f:4d:a8:1e:07:ee:73:b9:32:64:ae:97:  
           50:5d:6b:9e:9d:e8:2e:c8:ae:a0:6e:9a:2b:5d:ad:  
           89:b4:c9:b5:91:5a:d4:e3:a5:80:3d:71:87:87:d7:  
           0f:c4:98:11:02  
         ASN1 OID: prime256v1  
         NIST CURVE: P-256  
     X509v3 extensions:  
       X509v3 Extended Key Usage:   
         TLS Web Server Authentication  
       X509v3 Key Usage: critical  
         Digital Signature  
       X509v3 Subject Alternative Name:   
         DNS:*.google.com, DNS:*.android.com, DNS:*.appengine.google.com, DNS:*.cloud.google.com, DNS:*.g.co, DNS:*.gcp.gvt2.com, DNS:*.ggpht.cn, DNS:*.google-analytics.com, DNS:*.google.ca, DNS:*.google.cl, DNS:*.google.co.in, DNS:*.google.co.jp, DNS:*.google.co.uk, DNS:*.google.com.ar, DNS:*.google.com.au, DNS:*.google.com.br, DNS:*.google.com.co, DNS:*.google.com.mx, DNS:*.google.com.tr, DNS:*.google.com.vn, DNS:*.google.de, DNS:*.google.es, DNS:*.google.fr, DNS:*.google.hu, DNS:*.google.it, DNS:*.google.nl, DNS:*.google.pl, DNS:*.google.pt, DNS:*.googleadapis.com, DNS:*.googleapis.cn, DNS:*.googlecommerce.com, DNS:*.googlevideo.com, DNS:*.gstatic.cn, DNS:*.gstatic.com, DNS:*.gstaticcnapps.cn, DNS:*.gvt1.com, DNS:*.gvt2.com, DNS:*.metric.gstatic.com, DNS:*.urchin.com, DNS:*.url.google.com, DNS:*.youtube-nocookie.com, DNS:*.youtube.com, DNS:*.youtubeeducation.com, DNS:*.youtubekids.com, DNS:*.yt.be, DNS:*.ytimg.com, DNS:android.clients.google.com, DNS:android.com, DNS:developer.android.google.cn, DNS:developers.android.google.cn, DNS:g.co, DNS:ggpht.cn, DNS:goo.gl, DNS:google-analytics.com, DNS:google.com, DNS:googlecommerce.com, DNS:source.android.google.cn, DNS:urchin.com, DNS:www.goo.gl, DNS:youtu.be, DNS:youtube.com, DNS:youtubeeducation.com, DNS:youtubekids.com, DNS:yt.be  
       Authority Information Access:   
         CA Issuers - URI:http://pki.goog/gsr2/GTSGIAG3.crt  
         OCSP - URI:http://ocsp.pki.goog/GTSGIAG3  
       X509v3 Subject Key Identifier:   
         6D:79:12:FD:4A:05:C5:0E:3B:F0:29:84:84:51:AE:10:BB:FD:C0:2C  
       X509v3 Basic Constraints: critical  
         CA:FALSE  
       X509v3 Authority Key Identifier:   
         keyid:77:C2:B8:50:9A:67:76:76:B1:2D:C2:86:D0:83:A0:7E:A6:7E:BA:4B  
       X509v3 Certificate Policies:   
         Policy: 1.3.6.1.4.1.11129.2.5.3  
         Policy: 2.23.140.1.2.2  
       X509v3 CRL Distribution Points:   
         Full Name:  
          URI:http://crl.pki.goog/GTSGIAG3.crl  
   Signature Algorithm: sha256WithRSAEncryption  
      46:5b:10:d4:b8:64:93:fe:61:40:bf:5c:5e:24:be:c8:25:5c:  
      97:b2:3b:72:21:a3:f2:41:96:9a:bd:5a:be:fd:e5:52:f4:87:  
      a4:8b:1e:a9:25:0f:80:92:26:c5:bc:fd:9f:2a:af:49:c6:b9:  
      2d:15:db:ec:1c:93:00:37:dc:74:47:86:17:6b:41:a4:71:4c:  
      e1:91:31:07:ad:7f:a0:43:8a:1e:44:f9:87:f3:76:99:1f:70:  
      80:cf:63:2f:e2:c8:81:f2:7d:dd:20:1c:31:ac:e0:1c:06:37:  
      bf:2a:5b:c6:0e:6a:85:d3:c6:32:ea:dc:25:46:de:cb:c1:c5:  
      40:f3:87:9b:c6:45:e0:22:07:3c:56:c2:33:c0:14:6b:24:31:  
      85:4d:f3:38:b0:89:ba:eb:e2:84:af:05:b2:32:a7:cd:9e:be:  
      ca:31:94:c9:a7:d0:14:fc:1d:c8:f4:04:fb:01:b0:b9:69:66:  
      75:8a:d3:ae:d7:9e:08:a6:92:15:e1:c5:c0:53:9f:fb:c0:af:  
      7a:92:8b:03:1a:62:1b:88:19:d5:29:4a:da:11:f2:91:52:6d:  
      29:34:6f:04:03:a2:ef:ee:e0:c6:24:e8:de:59:cc:3c:3e:8d:  
      30:33:dd:f0:4c:59:0e:5b:73:22:55:81:88:43:a9:60:f0:f7:  
      9f:e0:b8:f2  

Please write comments if you find anything incorrect, or you want to share more information about the topic discussed above.

Comments

Popular posts from this blog

SSC Practice Problem Solution

SSC Practice Problem Solution In this post, we will discuss solution of  SSC Practice Problem . Question 1  The efficiency of (A + B) = 100/24 = (25/6)% The efficiency of (A + B + C) = 100/8 = (25/2)% The efficiency of C = 25/2 – 25/6 = (50/6)% Hence, C can alone finish this job in = 100/(50/6) = 12 days Answer: 12 days option (1) Question 2  Original price = Rs. 6000; Price after discount = 6000 – 1200 = Rs. 4800; Price after raising service contract = 4800 + 480 = Rs. 5280 Answer: Rs. 5280 option (2) Question 3  Suppose the received money by A, B, and C is respectively 5x, 6x, and 9x. 5x = 450; => x = 90; Hence, the total money = 20x = 20*90 = Rs. 1800; Answer: Rs. 1800 option (2) Question 4 Suppose the Cost price of the bag= Rs. x; Hence, x + 0.15x = 230; => x = Rs. 200; Selling price after selling on 20% = 200 + 20% of 200 = Rs. 240 Answer: Rs. 240 option (3) Question 5  The required percentage ...

Average

Average In this post, We will learn about average.  Average of any collection of data is the sum of data divide by number of data. Average = (Sum of observations /  Number of observations) Please write comments if you find anything incorrect, or you want to share more information about the topic discussed above.  problems The arithmetic mean of x, y and z is 80, and that of x, y, z, u and v is 75, where u=(x+y)/2 and v=(y+z)/2. If x ≥ z, then the minimum possible value of x is (CAT 2018) As specified in the question mean of x and y and z is 80 x+y+z=3*80 mean of x, y, z,u,v is 75 x+y+z+u+v=75*5 2u=x+y 2v=y+z x+y+z+((x+y+y+z)/2)=75*5 y+3(x+y+z)=75*10 y=750-720 y=30 since x+y+z=240 y=30 so x+z=210 since x>=z so minimum value of x=210/2 = 105 Problem2: In first 5 inings sehwag has scored at average of 40. In sixth ining He had scored 52 what is His average after 6th ining. one simple approach is getting total score divided by no of inin...

Complex Number

Complex Number While solving the equation of the form  a x 2 + b x + c = 0 , the roots of the equations can take three forms which are as follows: Two Distinct Real Roots Similar Root No Real roots (Complex Roots) The introduction of complex numbers in the 16th century made it possible to solve the equation  x 2 + 1 = 0 . The roots of the equation are of the form  x = ± − 1 ‾ ‾ ‾ √  and no real roots exist. Thus, with the introduction of complex numbers, we have Imaginary roots. We denote  − 1 ‾ ‾ ‾ √  with the symbol i, where i denotes Iota (Imaginary number). An equation of the form z= a+ib, where a and b are real numbers, is defined to be a complex number. The real part is denoted by Re z = a and the imaginary part is denoted by Im z = b. Algebraic Operation on Complex numbers: Addition of two complex numbers Subtraction of two complex number Multiplication of two complex number Division of two complex number Power of Iota (i) ...

Logarithm

Logarithm When a x   = N , then we say that x = logarithm of N to the base a and write it as x = log a N . In simple words, it represents the power to which a number must be raised. Let me expand on that by giving a simpler example. If we are asked, what would be the result if ‘a’ is multiplied with itself ‘b’ times; then your answer would be x = a*a*a*…. b (times). This can also be written as a^b. This is also known as ‘a raised to the power of b’ If we are asked, which number multiplied with itself ‘b’ times, will result in a; then you are asked for the value of x such that x*x*x*… b(times) = a => x^b = a => x = a^(1/b) This is also known as ‘bth root of a’ If swe are asked, how many times should you multiply ‘a’ with itself to get ‘b’, that is where the concept of logarithm comes into the picture. You are asked for the value of ‘x’ such that a*a*a…. x (times) = b => x = Log  a  b This is also known as ‘ Log b to the base a’ ...