B
B
Bulat Kurbangaliev2015-01-31 02:16:48
Python
Bulat Kurbangaliev, 2015-01-31 02:16:48

How to extract data from a certificate?

There is a task to parse the data from the certificate. These certificates are initially in the *.sig extension, but they open perfectly with notepad and are read by the base64 decoder (they are not read very well, there is noise in the output). I found a wonderful chilkat library (there are different implementations, I used the one that is under python). She can pull out individual fields, such as: organization name, tax number, etc. Everything was fine while the parser worked on windows. It so happened that now there is a need to run the script from under Linux (ubuntu). The implementation of chilkat under Linux does not produce errors, but it cannot parse individual fields of the certificate (as it seemed to me, exactly those where Russian letters are found.). I tried to describe the situation in as much detail as possible, I don’t throw links to files, since the site’s policy doesn’t seem to be allowed ..
UPD
We managed to find out one more circumstance. I installed the Linux virtual machine (ubuntu 14.04 Russian version) via vmware, and there the chilkat library was able to parse the data from the certificate. Actually, perhaps, the matter is in the localization of the OS? (server from amazon ec2, respectively, the localization eng should be)

Answer the question

In order to leave comments, you need to log in

2 answer(s)
B
Bulat Kurbangaliev, 2015-02-02
@ilov3

As a result, everything turned out to be simple and uncomplicated - I changed the locale in Linux to ru_RU and it all worked.

V
Vladimir Martyanov, 2015-01-31
@vilgeforce

Look towards the ssl module for python: https://docs.python.org/2/library/ssl.html

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question