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

Hamdan Shafiq
Hamdan Shafiq used Ask the Experts™
on
$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);
Comment
Watch Question

Do more with

Expert Office
EXPERT OFFICE® is a registered trademark of EXPERTS EXCHANGE®
Top Expert 2016

Commented:
What does that have to do with Java? - it looks distinctly like php to me ...
Hamdan ShafiqFull Stack PHP Developer

Author

Commented:
i need for  curl code
Top Expert 2016

Commented:
Sorry - i don't understand how that answers my question, and how it relates to the title of your question
Hamdan ShafiqFull Stack PHP Developer

Author

Commented:
how can create  keystore (JKS) to PEM?
Top Expert 2016
Commented:
Probably can be done with openssl if you look into it. I could do it for you but it would have to be on Live

Do more with

Expert Office
Submit tech questions to Ask the Experts™ at any time to receive solutions, advice, and new ideas from leading industry professionals.

Start 7-Day Free Trial