Mac OS X生成RSA公钥和私钥
生成私钥
genrsa -out rsa_private_key.pem 1024
生成公钥
rsa -in rsa_private_key.pem -pubout -out rsa_public_key.pem
如下
df@DFdeMacBook-Pro yzx % mkdir RSAkey
df@DFdeMacBook-Pro yzx % cd RSAkey
df@DFdeMacBook-Pro RSAkey % sudo apt-get install openssl
Password:
sudo: apt-get: command not found
df@DFdeMacBook-Pro RSAkey % brew install openssl
zsh: command not found: brew
df@DFdeMacBook-Pro RSAkey % openssl
OpenSSL> genrsa -out rsa_private_key.pem 1024
Generating RSA private key, 1024 bit long modulus
.++++++
.............................++++++
e is 65537 (0x10001)
OpenSSL> rsa -in rsa_private_key.pem -pubout -out rsa_public_key.pem
writing RSA key
OpenSSL> exit
df@DFdeMacBook-Pro RSAkey %