python - Get .pfx Cert File Expiration with pyOpenSSL -


i'm trying use pyopenssl check expiration of .pfx file client need use application. issue cert client, , expires every 2 years. know using openssl in command line works, converting .pem , running '-noout -enddate' on resulting .pem file.

there chance client not have openssl installed, i'd use library if possible. how check .pfx expiration date? i've gotten cert loaded, have no idea how a) convert .pem file (if need to) , b) check expiration on .pem file (or encoded string).

thanks!

so far:

import openssl  openssl.crypto import * cert_path = 'c:\\clients\\omega\\bos.omegaadv.gtssloader.pfx' p12 = load_pkcs12(open(cert_path, 'rb').read(), 'globallink') x = p12.get_certificate()  print(openssl.crypto.dump_certificate(filetype_pem, p12.get_certificate()))  

code here


Comments

Popular posts from this blog

c++ - No viable overloaded operator for references a map -

java - Custom OutputStreamAppender not run: LOGBACK: No context given for <MYAPPENDER> -

java - Cannot secure connection using TLS -