Ethics can be a set of rules or standards to judge something right or wrong. Given a set of rules or standards can be changed depending on the environment and context (Gitman, 2020). Understanding ethical issues and unethical behaviours is the initial step to understand ethics. (Gitman, 2020) describes eleven…

If you have played around WSO2 Identity Server (probably any Identity Provider) there are couple instances where you have to generate JWT. OIDC private key JWT client authentication [1] , JWT grant type [2] are some of them.

Previously I have written simple Java Program to generate JWT [3] but…

  1. First you have to convert .jks into .p12 format.

keytool -importkeystore -srckeystore <source keystore>.jks -srcstorepass <source keystore password> -srckeypass <source key password> -srcalias <source alias> -destalias <destination alias> -destkeystore <destination keystore>.p12 -deststoretype PKCS12 -deststorepass <destination keystore password> -destkeypass <destination key password>

EX:
keytool -importkeystore -srckeystore wso2carbon.jks -srcstorepass wso2carbon -srckeypass wso2carbon -srcalias wso2carbon -destalias wso2carbon -destkeystore identity.p12 -deststoretype PKCS12 -deststorepass wso2carbon -destkeypass wso2carbon

2. Export private key from .p12 keystore

openssl pkcs12 -in <key store>.p12 -nodes -nocerts -out <some name>.pem

EX:
openssl pkcs12 -in identity.p12 -nodes -nocerts -out private_key.pem

3. Now you can open private_key.pem from text editor and check private key in between BEGIN PRIVATE KEY and END PRIVATE KEY

Gayan Madusanka

I have been playing around WSO2 Identity Server over 5 years and helping to many production customers including active product development.

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store