Jump to content

Using openssl in PHP


longtone

Recommended Posts

I'm trying to figure out openssl and I'm stuck at the first fence.

 

The private key is at

 

/home/mydomain/path/to/file.key

 

I have tried pasting the key into a string ie:

 

$key = "-----BEGIN RSA PRIVATE KEY-----ALoadOfRandomLookingCharactersWithNoSpacesOrLinebreaks-----END RSA PRIVATE KEY-----";

$output = (openssl_key_get_private( $key )) ? openssl_key_get_private( $key ) : false ;

//alternatively

$output = (openssl_key_get_private( $key, 'password' )) ? openssl_key_get_private( $key , 'password') : false ;

 

Where password is the challenge password listed on the certificate (only password I could see).

 

That doesn't work.

 

nor does:

$key = "//home/mydomain/path/to/file.key";

 

I've also tried saving the key with a pem extension with no luck

 

I'm using PHP 5 .2 .4  and openssl is enabled!

 

 

 

 

Link to comment
https://forums.phpfreaks.com/topic/104820-using-openssl-in-php/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.