pkiutil keygen

Generates a key pair.

pkiutil keygen -alg <alg> [-alg <alg>... -alg <alg>] -pubout <pubout> -privout <privout>

For example:

pkiutil keygen -alg RSA 2048 -alg ECDSA P-256 -pubout pub.pem -privout priv.pem

See below for a description of each option.

-alg <alg>

Generate the key pair with the <alg> algorithm, where <alg> is one of the algorithm identifiers listed in PKIUtil algorithm reference . Select more than one algorithm to generate a composite keypair .

Mandatory: Yes

-pubout <pubout>

Save the public key in a file with the <pubout> name.

Mandatory: Yes

-privout <privout>

Save the private key in a file with the <privout> name.

Mandatory: Yes