Skip to content

Instantly share code, notes, and snippets.

@JiboStore
Created April 22, 2014 05:29
Show Gist options
  • Select an option

  • Save JiboStore/11166252 to your computer and use it in GitHub Desktop.

Select an option

Save JiboStore/11166252 to your computer and use it in GitHub Desktop.

Revisions

  1. JiboStore created this gist Apr 22, 2014.
    8 changes: 8 additions & 0 deletions openssl_genrsa
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,8 @@
    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