cancel
Showing results for 
Search instead for 
Did you mean: 

How to obtain public-key.pem file to be used for Oauth2 Client

NilotpalM
Explorer
1,333

I am creating Oauth 2 client in SAP Successfactors using "Manage Oauth2 Client" option. I got a X.509 certificate which has a private key within it and a certificate. How should I extract the public key pem file from this? I am using openssl command like below for extracting but getting an error:

Command:

openssl x509 -pubkey -noout -in cert.pem > pubkey.pem

Error:

Could not read certificate from Certificate.pem

4C410000:error:1608010C:STORE routines:ossl_store_handle_load_result:unsupported:crypto\store\store_result.c:151:

4C410000:error:1608010C:STORE routines:ossl_store_handle_load_result:unsupported:crypto\store\store_result.c:151:

The private and public key pem files are required for me to get the SAML Assertion using the sf-oauth(https://www.npmjs.com/package/sf-oauth#generate-via-cli) npm utility.

Accepted Solutions (0)

Answers (2)

Answers (2)

kuflue
Participant
0 Kudos

I have the same problem!
We have a problem with the validation date of the x509 certificate generated by SuccessFactors. So I want to check the effective date using the following command
"openssl x509 -text -in public.pem"

I get the same error: "70500000:error:1608010C:STORE
routines:ossl_store_handle_load_result:unsupported:crypto\store\store_result.c:151:
The certificate could not be loaded"

The two commands “openssl pkey -pubout -in privkey.pem -out pubkey.pem” and “openssl x509 -text -in cert.pem” also lead to the same error message.

@nmahadani have you been able to solve the problem now or does anyone else have an idea?

BR
Kurt

CarlosRoggan
Product and Topic Expert
Product and Topic Expert
0 Kudos

Hello,

I haven't had this error before, but maybe the command should be rather

openssl pkey -pubout -in privkey.pem -out pubkey.pem

?

Is it possible to read the content with:

openssl x509 -text -in cert.pem

?

Or try using a different version of openssl?