-
generate private key:
openssl genrsa -out rsa_2048_priv.pem 2048
-
generate public key (used by h5):
openssl rsa -pubout -in rsa_2048_priv.pem -out rsa_2048_pub.pem
-
save private key using PKCS#8 format
openssl pkcs8 -topk8 -nocrypt -in rsa_2048_priv.pem -out rsa_2048_priv.p8
edit the ouput file "rsa_2048_priv.p8", remove first & last line, concatenate the left lines and save to db as private key
if the serverside written by JAVA
Reference: https://medium.com/@tikiatua/symmetric-and-asymmetric-encryption-with-javascript-and-go-240043e56daf