NAME

openssl-pkey, pkey - public or private key processing tool

SYNOPSIS

openssl pkey [-help] [-inform PEM|DER] [-outform PEM|DER] [-in filename] [-passin arg] [-out filename] [-passout arg] [-traditional] [-cipher] [-text] [-text_pub] [-noout] [-pubin] [-pubout] [-engine id] [-check] [-pubcheck]

DESCRIPTION

The pkey command processes public or private keys. They can be converted between various forms and their components printed out.

OPTIONS

EXAMPLES

To remove the pass phrase on an RSA private key:

openssl pkey -in key.pem -out keyout.pem

To encrypt a private key using triple DES:

openssl pkey -in key.pem -des3 -out keyout.pem

To convert a private key from PEM to DER format:

openssl pkey -in key.pem -outform DER -out keyout.der

To print out the components of a private key to standard output:

openssl pkey -in key.pem -text -noout

To print out the public components of a private key to standard output:

openssl pkey -in key.pem -text_pub -noout

To just output the public part of a private key:

openssl pkey -in key.pem -pubout -out pubkey.pem

SEE ALSO

genpkey (1), rsa (1), pkcs8 (1), dsa (1), genrsa (1), gendsa (1)

COPYRIGHT

Copyright 2006-2021 The OpenSSL Project Authors. All Rights Reserved.

Licensed under the OpenSSL license (the License). You may not use this file except in compliance with the License. You can obtain a copy in the file LICENSE in the source distribution or at <https://www.openssl.org/source/license.html>.