Sponsored Content
Top Forums Programming Extract Common Name (CN) of SSL certificate using perl code Post 302837901 by jhamaks on Saturday 27th of July 2013 12:20:22 PM
Old 07-27-2013
Thank you achenle Smilie

i had to install this module and other dependent modules to make it work.
I'm using rather openssl command in my perl code to get the ssl certificate "subject" to get the CN.

Code:
openssl x509 -in QA.channelnet.us.cer -noout -subject

But now i need the perl code which can extract the individual ssl certs from one single file. The single file looks same as posted earlier.

Code:
--------------------BEGIN CERTIFICATE------------------
MIID2TCCAsGgAwIBAgIDAjbQMA0GCSqGSIb3DQEBBQUAME
4NwdzxoQ2KDLX4z6DOW/cf/lXUQdpj6HR/oaToODEj+IZpWYeZqF
                             :                             
                             :
6wJHzSXj8gYETpnKXKBuervdo5AaRTPvvz7SBMS24CqFZUE+ENQ=
--------------------END CERTIFICATE-----------------------
--------------------BEGIN CERTIFICATE----------------------
MIIDVDCCAjygAwIBAgIDAjRWMA0GCSqGSIb3DQEBBQUAME
IxCzAJBgNVBAYTAlVTAq45pmp0sdhsdkslswqpywmcperewe
                           :                             
                           :                              
hw4EbNX/3aBd7YdStysV6drE57xNNB6pXE0zX5IJL4hmXXeXx
x12E6nV5fEWCRE11azbJHFwLJhWC9kXtNHjUStedejV0NxPNO3=
--------------------END CERTIFICATE-----------------------

I want to extract the individual certs from above file and store it on the disk with some name(may be appending timestamp to some pre-determined file name).

Last edited by jhamaks; 07-27-2013 at 01:24 PM.. Reason: data display not proper
 

9 More Discussions You Might Find Interesting

1. Web Development

SSL Certificate Installation problem

Hello everybody Hope somebody can help me I'm trying to install SSL Certificate on Apache/mod_ssl on Linux with Zend for Oracle. I bought and downloaded certificate from certificate from Network Solutions. Than I followed the instructions to the dot. I created a directory for certificate... (2 Replies)
Discussion started by: Trusevich
2 Replies

2. Web Development

SSL certificate

Dear All Anyone know how to issue two different certification on apache virtualhost fyi i have one virtualhost eg 69.192.1.25:443 already signed with verisign how can i configure another virtualhost 69.192.1.25:443 which signing with another certificate which self signing. i search net not... (1 Reply)
Discussion started by: netxus
1 Replies

3. AIX

Installing SSL certificate on AIX

Hello, I am new in UNIX, and some one asks me to install SSL certificates to allow exchange with an external system. Can someone tell how to install certificate (ex : verisignxxx.cer) on a UNIX server? Many thanks. Tibo (4 Replies)
Discussion started by: tibo51
4 Replies

4. Cybersecurity

SSL certificate

Hi guys. I have some questions about ssl certificates. I looked at SSL providers and saw that they are providing 2 types of certificates: per server or per domain. my server host name is: srv1.example.com I have a smtp, imap, web server on this box. but all services accessed by different... (1 Reply)
Discussion started by: majid.merkava
1 Replies

5. Web Development

export SSL certificate

we are doing TCP for our systems. I have a working SSL certificate on prodction webserver. Im planning to export it to our DR server for TCP purposes. However when I export based on the procedure below, it doesn't work. When I restart the DR webserver, it still says the certifcate is expired.Any... (1 Reply)
Discussion started by: lhareigh890
1 Replies

6. Red Hat

SSL Certificate Renewal on Tomcat

Hi, I want to renew the ssl certificate for one of my application on tomcat without down time. I want to know what would the possible impacts for the users who currently have sessions to the app. Regards, Arumon (1 Reply)
Discussion started by: arumon
1 Replies

7. Programming

Perl to extract ssl certs from xml file

HI Guys, I'm a newbie in perl. (4 Replies)
Discussion started by: jhamaks
4 Replies

8. Cybersecurity

SSL Certificate Stores

Hey everyone, I'm trying to get a lay of the land for OS and Application Certificate Stores. Can someone confirm that I have this concept right? If the application you're using say Firefox has it's own trusted CA store, it uses that exclusively. So if you're running firefox in Windows, Firefox... (4 Replies)
Discussion started by: Lost in Cyberia
4 Replies

9. Web Development

CronJobs issues after SSL certificate

Hello! I had a cron job running on my website, activating a php script every friday. The Php script just activated another photo to add in the gallery. It worked fine until I got an SSL certificate for my website, then everything broke. This was the command before: lynx -source... (0 Replies)
Discussion started by: AGDesign
0 Replies
PKCS7(1)							      OpenSSL								  PKCS7(1)

NAME
pkcs7 - PKCS#7 utility SYNOPSIS
openssl pkcs7 [-inform PEM|DER] [-outform PEM|DER] [-in filename] [-out filename] [-print_certs] [-text] [-noout] [-engine id] DESCRIPTION
The pkcs7 command processes PKCS#7 files in DER or PEM format. COMMAND OPTIONS
-inform DER|PEM This specifies the input format. DER format is DER encoded PKCS#7 v1.5 structure.PEM (the default) is a base64 encoded version of the DER form with header and footer lines. -outform DER|PEM This specifies the output format, the options have the same meaning as the -inform option. -in filename This specifies the input filename to read from or standard input if this option is not specified. -out filename specifies the output filename to write to or standard output by default. -print_certs prints out any certificates or CRLs contained in the file. They are preceded by their subject and issuer names in one line format. -text prints out certificates details in full rather than just subject and issuer names. -noout don't output the encoded version of the PKCS#7 structure (or certificates is -print_certs is set). -engine id specifying an engine (by it's unique id string) will cause req to attempt to obtain a functional reference to the specified engine, thus initialising it if needed. The engine will then be set as the default for all available algorithms. EXAMPLES
Convert a PKCS#7 file from PEM to DER: openssl pkcs7 -in file.pem -outform DER -out file.der Output all certificates in a file: openssl pkcs7 -in file.pem -print_certs -out certs.pem NOTES
The PEM PKCS#7 format uses the header and footer lines: -----BEGIN PKCS7----- -----END PKCS7----- For compatibility with some CAs it will also accept: -----BEGIN CERTIFICATE----- -----END CERTIFICATE----- RESTRICTIONS
There is no option to print out all the fields of a PKCS#7 file. This PKCS#7 routines only understand PKCS#7 v 1.5 as specified in RFC2315 they cannot currently parse, for example, the new CMS as described in RFC2630. SEE ALSO
crl2pkcs7(1) 0.9.7d 2003-11-20 PKCS7(1)
All times are GMT -4. The time now is 08:16 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy