tags:

views:

1100

answers:

2

What the .pem file contain? simply a key or a function which generate the key.

I need to create a .pem file and also need to call this file in a function.

here is code to which I have to proceed:

pk = open( 'public_key.pem', 'rb' ).read()
rsa = M2Crypto.RSA.load_pub_key(pk)
A: 

You can use openssl to create a pem file. You will need to supply it the correct parameters to get the correct type of key. The genkey command of openssl looks like what you want to use.

Andrew Cox
And if you are using it you should know about the keystore to set it for your application.
Umesh Aawte
A: 

There is good article I found. Please try this.

Umesh Aawte