Vous ne pouvez pas sélectionner plus de 25 sujets Les noms de sujets doivent commencer par une lettre ou un nombre, peuvent contenir des tirets ('-') et peuvent comporter jusqu'à 35 caractères.
 
 
 
 
 
 

83 lignes
2.8 KiB

  1. /* Copyright (c) 2014, Google Inc.
  2. *
  3. * Permission to use, copy, modify, and/or distribute this software for any
  4. * purpose with or without fee is hereby granted, provided that the above
  5. * copyright notice and this permission notice appear in all copies.
  6. *
  7. * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
  8. * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
  9. * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY
  10. * SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
  11. * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION
  12. * OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN
  13. * CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */
  14. #ifndef OPENSSL_HEADER_TOOL_INTERNAL_H
  15. #define OPENSSL_HEADER_TOOL_INTERNAL_H
  16. #include <openssl/base.h>
  17. #include <string>
  18. #include <vector>
  19. #if defined(_MSC_VER)
  20. #pragma warning(push)
  21. // MSVC issues warning C4702 for unreachable code in its xtree header when
  22. // compiling with -D_HAS_EXCEPTIONS=0. See
  23. // https://connect.microsoft.com/VisualStudio/feedback/details/809962
  24. #pragma warning(disable: 4702)
  25. #endif
  26. #include <map>
  27. #if defined(_MSC_VER)
  28. #pragma warning(pop)
  29. #endif
  30. enum ArgumentType {
  31. kRequiredArgument,
  32. kOptionalArgument,
  33. kBooleanArgument,
  34. };
  35. struct argument {
  36. const char *name;
  37. ArgumentType type;
  38. const char *description;
  39. };
  40. bool ParseKeyValueArguments(std::map<std::string, std::string> *out_args, const
  41. std::vector<std::string> &args, const struct argument *templates);
  42. void PrintUsage(const struct argument *templates);
  43. bool GetUnsigned(unsigned *out, const std::string &arg_name,
  44. unsigned default_value,
  45. const std::map<std::string, std::string> &args);
  46. bool Ciphers(const std::vector<std::string> &args);
  47. bool Client(const std::vector<std::string> &args);
  48. bool DoPKCS12(const std::vector<std::string> &args);
  49. bool GenerateEd25519Key(const std::vector<std::string> &args);
  50. bool GenerateRSAKey(const std::vector<std::string> &args);
  51. bool MD5Sum(const std::vector<std::string> &args);
  52. bool Rand(const std::vector<std::string> &args);
  53. bool SHA1Sum(const std::vector<std::string> &args);
  54. bool SHA224Sum(const std::vector<std::string> &args);
  55. bool SHA256Sum(const std::vector<std::string> &args);
  56. bool SHA384Sum(const std::vector<std::string> &args);
  57. bool SHA512Sum(const std::vector<std::string> &args);
  58. bool Server(const std::vector<std::string> &args);
  59. bool Speed(const std::vector<std::string> &args);
  60. // These values are DER encoded, RSA private keys.
  61. extern const uint8_t kDERRSAPrivate2048[];
  62. extern const size_t kDERRSAPrivate2048Len;
  63. extern const uint8_t kDERRSAPrivate4096[];
  64. extern const size_t kDERRSAPrivate4096Len;
  65. extern const uint8_t kDERRSAPrivate3Prime2048[];
  66. extern const size_t kDERRSAPrivate3Prime2048Len;
  67. #endif /* !OPENSSL_HEADER_TOOL_INTERNAL_H */