Skip to content

Instantly share code, notes, and snippets.

@JiboStore
Created April 22, 2014 05:29
Show Gist options
  • Save JiboStore/11166252 to your computer and use it in GitHub Desktop.
Save JiboStore/11166252 to your computer and use it in GitHub Desktop.
GENERATE PUBLIC/PRIVATE KEY PAIR:
GENERATE PUBLIC/PRIVATE KEY PAIR:
For PHP:
openssl genrsa > drmsign.pem
openssl rsa -in drmsign.pem -pubout > drmsign.pub
Then convert to DER (required by Java):
http://codeartisan.blogspot.sg/2009/05/public-key-cryptography-in-java.html
openssl pkcs8 -topk8 -inform PEM -outform DER -in drmsign.pem -out drmsign.der -nocrypt
openssl rsa -in drmsign.pem -pubout -outform DER -out drmsign_pub.der
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment