c_rehash.pod 2.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081
  1. =pod
  2. =for comment
  3. Original text by James Westby, contributed under the OpenSSL license.
  4. =head1 NAME
  5. c_rehash - Create symbolic links to files named by the hash values
  6. =head1 SYNOPSIS
  7. B<c_rehash>
  8. [ I<directory>...]
  9. =head1 DESCRIPTION
  10. B<c_rehash> scans directories and calculates a hash value of each C<.pem>
  11. file in the specified directory list and creates symbolic links
  12. for each file, where the name of the link is the hash value.
  13. This utility is useful as many programs that use OpenSSL require
  14. directories to be set up like this in order to find certificates.
  15. If any directories are named on the command line, then those are
  16. processed in turn. If not, then the B<SSL_CERT_DIR> environment variable
  17. is consulted; this shold be a colon-separated list of directories,
  18. like the Unix B<PATH> variable.
  19. If that is not set then the default directory (installation-specific
  20. but often B</usr/local/ssl/certs>) is processed.
  21. In order for a directory to be processed, the user must have write
  22. permissions on that directory, otherwise it will be skipped.
  23. The links created are of the form C<HHHHHHHH.D>, where each B<H>
  24. is a hexadecimal character and B<D> is a single decimal digit.
  25. When processing a directory, B<c_rehash> will first remove all links
  26. that have a name in that syntax. If you have links in that format
  27. used for other purposes, they will be removed.
  28. Hashes for CRL's look similar except the letter B<r> appears after
  29. the period, like this: C<HHHHHHHH.rD>.
  30. Multiple objects may have the same hash; they will be indicated by
  31. incrementing the B<D> value. Duplicates are found by comparing the
  32. full SHA-1 fingerprint. A warning will be displayed if a duplicate
  33. is found.
  34. A warning will also be displayed if there are B<.pem> files that
  35. cannot be parsed as either a certificate or a CRL.
  36. The program uses the B<openssl> program to compute the hashes and
  37. fingerprints. If not found in the user's B<PATH>, then set the
  38. B<OPENSSL> environment variable to the full pathname.
  39. Any program can be used, it will be invoked as follows for either
  40. a certificate or CRL:
  41. $OPENSSL x509 -hash -fingerprint -noout -in FFFFFF
  42. $OPENSSL crl -hash -fingerprint -noout -in FFFFFF
  43. where B<FFFFFF> is the filename. It must output the hash of the
  44. file on the first line, and the fingerprint on the second,
  45. optionally prefixed with some text and an equals sign.
  46. =head1 ENVIRONMENT
  47. =over
  48. =item B<OPENSSL>
  49. The path to an executable to use to generate hashes and
  50. fingerprints (see above).
  51. =item B<SSL_CERT_DIR>
  52. Colon separated list of directories to operate on.
  53. Ignored if directories are listed on the command line.
  54. =back
  55. =head1 SEE ALSO
  56. L<openssl(1)|openssl(1)>,
  57. L<crl(1)|crl(1)>.
  58. L<x509(1)|x509(1)>.