2
0

dsa.pod 4.3 KB

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