Link to home
Start Free TrialLog in
Avatar of Hamdan Shafiq
Hamdan ShafiqFlag for Pakistan

asked on

How to convert a Java keystore (JKS) to PEM format

$certStore=dirname(__FILE__)."/cert/cert.pem";
            $caStore=dirname(__FILE__)."/cert/ca.pem";
            $keyStore=dirname(__FILE__)."/cert/key.pem";
            
        $keyPass=$this->session->data['key'];
            $keyStoreType= "PEM";
            $ch= curl_init();
            curl_setopt($ch, CURLOPT_URL, $gateway_url);
            curl_setopt($ch, CURLOPT_VERBOSE, true);
            curl_setopt($ch, CURLOPT_POST, 1);
            curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
            curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, true);
            curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, true);
            curl_setopt($ch, CURLOPT_PORT, 443);
            curl_setopt($ch, CURLOPT_CAINFO,$caStore);
            curl_setopt($ch, CURLOPT_SSLCERT,$certStore);
            curl_setopt($ch, CURLOPT_SSLKEY,$keyStore);
            curl_setopt($ch, CURLOPT_SSLCERTPASSWD, $keyPass);
            curl_setopt($ch, CURLOPT_SSLKEYTYPE,$keyStoreType);        
            $headers = array();
       array_push($headers, "Content-Type: text/xml; charset=utf-8");
       array_push($headers, "SOAPAction: sii:RB_OLP_INITIATE_PAYMENT");
       array_push($headers, "Host:b2brbtest.riyadbank.com");
            if($request_string != null) {
       curl_setopt($ch, CURLOPT_POSTFIELDS, $request_string);
       array_push($headers, "Content-Length: " . strlen($request_string));
     }
            curl_setopt($ch, CURLOPT_HTTPHEADER,$headers);
            
       curl_setopt($ch, CURLOPT_POST, true);
Avatar of CEHJ
CEHJ
Flag of United Kingdom of Great Britain and Northern Ireland image

What does that have to do with Java? - it looks distinctly like php to me ...
Avatar of Hamdan Shafiq

ASKER

i need for  curl code
Sorry - i don't understand how that answers my question, and how it relates to the title of your question
how can create  keystore (JKS) to PEM?
ASKER CERTIFIED SOLUTION
Avatar of CEHJ
CEHJ
Flag of United Kingdom of Great Britain and Northern Ireland image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial