openssl genrsa -out pri.pem 2048.
openssl rsa -inform PEM -in pri.pem -outform D -out pri.der
openssl rsa -pubout -inform DER -in pri.der -outform D -out pub.der