Jump to content

Openssl pkey problem


seansammut

Recommended Posts

Hi there,

 

I am currently using Openssl to ecrypt data using assymetric encryption although I am having some problems.

 

<?php

$config = array("config" => "C:/wamp/bin/apache/Apache2.2.11/conf/openssl.cnf");

 

$res=openssl_pkey_new($config);

 

// Get private key

openssl_pkey_export($res, $privatekey);

 

$publickey=openssl_pkey_get_details($res);

$publickey=$publickey["key"];

?>

 

 

In the above code I am having problems with the primary key. The public key works and when I use var dump i get a result although with pkey_export all I get is a NULL and the function returns a false. Can you hep me in identifying what's causing the problem?

 

Many thanks,

Sean Sammut

Link to comment
https://forums.phpfreaks.com/topic/182426-openssl-pkey-problem/
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.