Thursday, May 29, 2025

SAP IS: How to convert the SSH key to p12 format for loading into SAP IS Key Store

SAP IS: How to convert the SSH key to p12 format for loading into SAP IS Key Store.

You can refer the below link to see how to generate the SSH Key pair

SAP IS: How to create an SSH Key pair for SFTP Connection


Download portable cygwin from Portable Cygwin

Once downloaded, you need to uncomment the entries in the cygwin-portable-config.bat and add 'openssl' also to the CYGWN_PACKAGES variable.



Now execute the file cygwin-portable-setup.cmd. This will create a set of folders under the main folder.

You can also install cygwin by following  Setting Up Cygwin/X


Now, you need to follow the below steps to convert the SSH key to p12 format.

1. Copy the generated SSH key into a folder where cygwin can access. In my case I created a folder under Data/admin/aj and copied my ssh key into that folder.



2. Run the file cygwin-portable-terminal.cmd  as administrator

3. Use OpenSSL package commands to create X.509 certificate

openssl req -new -x509 -days 7300 -key ./aj/ajohny_ssh_new.pem -out ./aj/ajohny_ssh_new.x509


Enter the Pass Phrase for the SSH Key (If you have entered pass phrase when generating the key)

Enter the below details when asked: (You can leave it blank as well if you want)

1. Country Name

2. State

3. Locality Name

4. Organization Name

5. Organizational Unit Name

6. Common Name

7. Email Address


Now you can see the certificate is created.


3. Now create the p12 file from the certificate created above

openssl pkcs12 -export -in ./aj/ajohny_ssh.x509 -inkey ./aj/ajohny_ssh.pem -out ./aj/ajohny_ssh.p12


Enter the Pass Phrase for the SSH Key (If you have entered pass phrase when generating the key)


Enter the export password for the p12 file.





Reference : The KEY to unlock the "KEY GENERATION" mystery - SFTP/SSH




Feel free to point out if anything is missing/wrong in this blog.

No comments:

Post a Comment

SAP IS : Boost Your Productivity with SAP CPI Helper Extension for SAP BTP Integration Suite

  If you're working with SAP BTP Integration Suite (IS) —especially with Cloud Integration (formerly CPI) —you probably know how powerfu...