Credential.hpp 1.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758
  1. /*
  2. * ZeroTier One - Network Virtualization Everywhere
  3. * Copyright (C) 2011-2016 ZeroTier, Inc. https://www.zerotier.com/
  4. *
  5. * This program is free software: you can redistribute it and/or modify
  6. * it under the terms of the GNU General Public License as published by
  7. * the Free Software Foundation, either version 3 of the License, or
  8. * (at your option) any later version.
  9. *
  10. * This program is distributed in the hope that it will be useful,
  11. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  12. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  13. * GNU General Public License for more details.
  14. *
  15. * You should have received a copy of the GNU General Public License
  16. * along with this program. If not, see <http://www.gnu.org/licenses/>.
  17. */
  18. #ifndef ZT_CREDENTIAL_HPP
  19. #define ZT_CREDENTIAL_HPP
  20. #include <string>
  21. #include <memory>
  22. #include <stdexcept>
  23. #include <stdio.h>
  24. #include <stdlib.h>
  25. #include <stdint.h>
  26. #include <string.h>
  27. #include "Constants.hpp"
  28. namespace ZeroTier {
  29. /**
  30. * Base class for credentials
  31. */
  32. class Credential
  33. {
  34. public:
  35. /**
  36. * Do not change type code IDs -- these are used in Revocation objects and elsewhere
  37. */
  38. enum Type
  39. {
  40. CREDENTIAL_TYPE_NULL = 0,
  41. CREDENTIAL_TYPE_COM = 1, // CertificateOfMembership
  42. CREDENTIAL_TYPE_CAPABILITY = 2,
  43. CREDENTIAL_TYPE_TAG = 3,
  44. CREDENTIAL_TYPE_COO = 4, // CertificateOfOwnership
  45. CREDENTIAL_TYPE_COR = 5, // CertificateOfRepresentation
  46. CREDENTIAL_TYPE_REVOCATION = 6
  47. };
  48. };
  49. } // namespace ZeroTier
  50. #endif