Openssl
RSA
Generate RSA keys
On Openssl:
openssl genrsa -out rsa.pem 1024
openssl rsa -in rsa.pem -pubout -outform pem -out rsa-pub.out
On Coherence:
From Openssl to Coherence priv key
openssl pkcs8 -nocrypt -in rsa.pem -inform PEM -topk8 -outform DER -out rsa.der
cat rsa.der | xxd -ps | paste -s -d '' > rsa.der.hex
From Openssl to Coherence pub key
openssl rsa -in rsa.pem -pubout -outform DER -out rsa-pub.der
cat rsa-pub.der | xxd -ps | paste -s -d '' > rsa-pub.der.hex
From Coherence to Openssl priv key
cat crsa.der.hex | xxd -r -p - > crsa.der
openssl rsa -inform der -outform pem -in crsa.der -out crsa.pem
From Coherence to Openssl pub key
cat crsa-pub.der.hex | xxd -r -p - > crsa-pub.der
openssl rsa -inform der -outform pem -pubin -in crsa-pub.der -out crsa-pub.pem
DSA
Generate DSA keys
On Openssl:
openssl dsaparam -out dsa-param.pem 1024
openssl gendsa -out dsa.pem dsa-param.pem
openssl dsa -in dsa.pem -pubout -outform PEM -out dsa-pub.pem
On Coherence:
From Openssl to Coherence priv key
openssl pkcs8 -nocrypt -in dsa.pem -inform PEM -topk8 -outform DER -out dsa.der
cat dsa.der | xxd -ps | paste -s -d '' > dsa.der.hex
From Openssl to Coherence pub key
openssl dsa -in dsa.pem -pubout -outform DER -out dsa-pub.der
cat dsa-pub.der | xxd -ps | paste -s -d '' > dsa-pub.der.hex
From Coherence to Openssl priv key
cat cdsa.der.hex | xxd -r -p - > cdsa.der
openssl dsa -inform der -outform pem -in cdsa.der -out cdsa.pem
From Coherence to Openssl pub key
cat cdsa-pub.der.hex | xxd -r -p - > cdsa-pub.der
openssl dsa -inform der -outform pem -pubin -in cdsa-pub.der -out cdsa-pub.pem
Last updated