2
0

pkey.pod 3.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135
  1. =pod
  2. =head1 NAME
  3. pkey - public or private key processing tool
  4. =head1 SYNOPSIS
  5. B<openssl> B<pkey>
  6. [B<-inform PEM|DER>]
  7. [B<-outform PEM|DER>]
  8. [B<-in filename>]
  9. [B<-passin arg>]
  10. [B<-out filename>]
  11. [B<-passout arg>]
  12. [B<-cipher>]
  13. [B<-text>]
  14. [B<-text_pub>]
  15. [B<-noout>]
  16. [B<-pubin>]
  17. [B<-pubout>]
  18. [B<-engine id>]
  19. =head1 DESCRIPTION
  20. The B<pkey> command processes public or private keys. They can be converted
  21. between various forms and their components printed out.
  22. =head1 COMMAND OPTIONS
  23. =over 4
  24. =item B<-inform DER|PEM>
  25. This specifies the input format DER or PEM.
  26. =item B<-outform DER|PEM>
  27. This specifies the output format, the options have the same meaning as the
  28. B<-inform> option.
  29. =item B<-in filename>
  30. This specifies the input filename to read a key from or standard input if this
  31. option is not specified. If the key is encrypted a pass phrase will be
  32. prompted for.
  33. =item B<-passin arg>
  34. the input file password source. For more information about the format of B<arg>
  35. see the B<PASS PHRASE ARGUMENTS> section in L<openssl(1)|openssl(1)>.
  36. =item B<-out filename>
  37. This specifies the output filename to write a key to or standard output if this
  38. option is not specified. If any encryption options are set then a pass phrase
  39. will be prompted for. The output filename should B<not> be the same as the input
  40. filename.
  41. =item B<-passout password>
  42. the output file password source. For more information about the format of B<arg>
  43. see the B<PASS PHRASE ARGUMENTS> section in L<openssl(1)|openssl(1)>.
  44. =item B<-cipher>
  45. These options encrypt the private key with the supplied cipher. Any algorithm
  46. name accepted by EVP_get_cipherbyname() is acceptable such as B<des3>.
  47. =item B<-text>
  48. prints out the various public or private key components in
  49. plain text in addition to the encoded version.
  50. =item B<-text_pub>
  51. print out only public key components even if a private key is being processed.
  52. =item B<-noout>
  53. do not output the encoded version of the key.
  54. =item B<-pubin>
  55. by default a private key is read from the input file: with this
  56. option a public key is read instead.
  57. =item B<-pubout>
  58. by default a private key is output: with this option a public
  59. key will be output instead. This option is automatically set if
  60. the input is a public key.
  61. =item B<-engine id>
  62. specifying an engine (by its unique B<id> string) will cause B<pkey>
  63. to attempt to obtain a functional reference to the specified engine,
  64. thus initialising it if needed. The engine will then be set as the default
  65. for all available algorithms.
  66. =back
  67. =head1 EXAMPLES
  68. To remove the pass phrase on an RSA private key:
  69. openssl pkey -in key.pem -out keyout.pem
  70. To encrypt a private key using triple DES:
  71. openssl pkey -in key.pem -des3 -out keyout.pem
  72. To convert a private key from PEM to DER format:
  73. openssl pkey -in key.pem -outform DER -out keyout.der
  74. To print out the components of a private key to standard output:
  75. openssl pkey -in key.pem -text -noout
  76. To print out the public components of a private key to standard output:
  77. openssl pkey -in key.pem -text_pub -noout
  78. To just output the public part of a private key:
  79. openssl pkey -in key.pem -pubout -out pubkey.pem
  80. =head1 SEE ALSO
  81. L<genpkey(1)|genpkey(1)>, L<rsa(1)|rsa(1)>, L<pkcs8(1)|pkcs8(1)>,
  82. L<dsa(1)|dsa(1)>, L<genrsa(1)|genrsa(1)>, L<gendsa(1)|gendsa(1)>
  83. =cut