OpenSSL CSR generation with subject key from stdin

Solution 1:

*nix commands usually use a dash to represent stdin or stdout in the context of file parameters, so -key - is supposed to read the key from stdin. However, it seems that openssl doesn't implement this. Luckily, in Linux pretty much everything is a file, including stdin which can be accessed as /dev/stdin (which is actually a symlink to /proc/self/fd/0), so the following works:

openssl req -new -key /dev/stdin