Avatar of Hamdan Shafiq
Hamdan Shafiq
Flag 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);
Java

Avatar of undefined
Last Comment
CEHJ

8/22/2022 - Mon
CEHJ

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

ASKER
i need for  curl code
CEHJ

Sorry - i don't understand how that answers my question, and how it relates to the title of your question
Experts Exchange is like having an extremely knowledgeable team sitting and waiting for your call. Couldn't do my job half as well as I do without it!
James Murphy
Hamdan Shafiq

ASKER
how can create  keystore (JKS) to PEM?
ASKER CERTIFIED SOLUTION
CEHJ

THIS SOLUTION ONLY AVAILABLE TO MEMBERS.
View this solution by signing up for a free trial.
Members can start a 7-Day free trial and enjoy unlimited access to the platform.
See Pricing Options
Start Free Trial
GET A PERSONALIZED SOLUTION
Ask your own question & get feedback from real experts
Find out why thousands trust the EE community with their toughest problems.