Any idea how I can access key from a keystore or keyfile ( basically PKCS12 type). I do not want to create any connection. I just want to access this private key that will be on users machine, encrypt it and then send it as plain text string to the server as a param. We are doing this for some kind of authentication.
So how can I simply extract the key from keyfile? No SSL connection/certificate/etc needed.
I am using python to implement this.
SOL:
I was able to extract key using pyOpenSSL using below code:
>>> p12 = load_pkcs12(file("C:\XYZ\DistProfile.p12", "rb").read(), "passwd")
>>> p12.get_certificate()
>>> p12.get_privatekey()
>>> key_pem = dump_privatekey(FILETYPE_PEM,p12.get_privatekey())
Key_pem will have the private key