dsa.pod 4.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164
  1. =pod
  2. =head1 NAME
  3. dsa - DSA key processing
  4. =head1 SYNOPSIS
  5. B<openssl> B<dsa>
  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<-aes128>]
  13. [B<-aes192>]
  14. [B<-aes256>]
  15. [B<-camellia128>]
  16. [B<-camellia192>]
  17. [B<-camellia256>]
  18. [B<-des>]
  19. [B<-des3>]
  20. [B<-idea>]
  21. [B<-text>]
  22. [B<-noout>]
  23. [B<-modulus>]
  24. [B<-pubin>]
  25. [B<-pubout>]
  26. [B<-engine id>]
  27. =head1 DESCRIPTION
  28. The B<dsa> command processes DSA keys. They can be converted between various
  29. forms and their components printed out. B<Note> This command uses the
  30. traditional SSLeay compatible format for private key encryption: newer
  31. applications should use the more secure PKCS#8 format using the B<pkcs8>
  32. =head1 COMMAND OPTIONS
  33. =over 4
  34. =item B<-inform DER|PEM>
  35. This specifies the input format. The B<DER> option with a private key uses
  36. an ASN1 DER encoded form of an ASN.1 SEQUENCE consisting of the values of
  37. version (currently zero), p, q, g, the public and private key components
  38. respectively as ASN.1 INTEGERs. When used with a public key it uses a
  39. SubjectPublicKeyInfo structure: it is an error if the key is not DSA.
  40. The B<PEM> form is the default format: it consists of the B<DER> format base64
  41. encoded with additional header and footer lines. In the case of a private key
  42. PKCS#8 format is also accepted.
  43. =item B<-outform DER|PEM>
  44. This specifies the output format, the options have the same meaning as the
  45. B<-inform> option.
  46. =item B<-in filename>
  47. This specifies the input filename to read a key from or standard input if this
  48. option is not specified. If the key is encrypted a pass phrase will be
  49. prompted for.
  50. =item B<-passin arg>
  51. the input file password source. For more information about the format of B<arg>
  52. see the B<PASS PHRASE ARGUMENTS> section in L<openssl(1)|openssl(1)>.
  53. =item B<-out filename>
  54. This specifies the output filename to write a key to or standard output by
  55. is not specified. If any encryption options are set then a pass phrase will be
  56. prompted for. The output filename should B<not> be the same as the input
  57. filename.
  58. =item B<-passout arg>
  59. the output file password source. For more information about the format of B<arg>
  60. see the B<PASS PHRASE ARGUMENTS> section in L<openssl(1)|openssl(1)>.
  61. =item B<-aes128|-aes192|-aes256|-camellia128|-camellia192|-camellia256|-des|-des3|-idea>
  62. These options encrypt the private key with the specified
  63. cipher before outputting it. A pass phrase is prompted for.
  64. If none of these options is specified the key is written in plain text. This
  65. means that using the B<dsa> utility to read in an encrypted key with no
  66. encryption option can be used to remove the pass phrase from a key, or by
  67. setting the encryption options it can be use to add or change the pass phrase.
  68. These options can only be used with PEM format output files.
  69. =item B<-text>
  70. prints out the public, private key components and parameters.
  71. =item B<-noout>
  72. this option prevents output of the encoded version of the key.
  73. =item B<-modulus>
  74. this option prints out the value of the public key component of the key.
  75. =item B<-pubin>
  76. by default a private key is read from the input file: with this option a
  77. public key is read instead.
  78. =item B<-pubout>
  79. by default a private key is output. With this option a public
  80. key will be output instead. This option is automatically set if the input is
  81. a public key.
  82. =item B<-engine id>
  83. specifying an engine (by its unique B<id> string) will cause B<dsa>
  84. to attempt to obtain a functional reference to the specified engine,
  85. thus initialising it if needed. The engine will then be set as the default
  86. for all available algorithms.
  87. =back
  88. =head1 NOTES
  89. The PEM private key format uses the header and footer lines:
  90. -----BEGIN DSA PRIVATE KEY-----
  91. -----END DSA PRIVATE KEY-----
  92. The PEM public key format uses the header and footer lines:
  93. -----BEGIN PUBLIC KEY-----
  94. -----END PUBLIC KEY-----
  95. =head1 EXAMPLES
  96. To remove the pass phrase on a DSA private key:
  97. openssl dsa -in key.pem -out keyout.pem
  98. To encrypt a private key using triple DES:
  99. openssl dsa -in key.pem -des3 -out keyout.pem
  100. To convert a private key from PEM to DER format:
  101. openssl dsa -in key.pem -outform DER -out keyout.der
  102. To print out the components of a private key to standard output:
  103. openssl dsa -in key.pem -text -noout
  104. To just output the public part of a private key:
  105. openssl dsa -in key.pem -pubout -out pubkey.pem
  106. =head1 SEE ALSO
  107. L<dsaparam(1)|dsaparam(1)>, L<gendsa(1)|gendsa(1)>, L<rsa(1)|rsa(1)>,
  108. L<genrsa(1)|genrsa(1)>
  109. =cut