Credential.hpp 1.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152
  1. /*
  2. * Copyright (c)2019 ZeroTier, Inc.
  3. *
  4. * Use of this software is governed by the Business Source License included
  5. * in the LICENSE.TXT file in the project's root directory.
  6. *
  7. * Change Date: 2026-01-01
  8. *
  9. * On the date above, in accordance with the Business Source License, use
  10. * of this software will be governed by version 2.0 of the Apache License.
  11. */
  12. /****/
  13. #ifndef ZT_CREDENTIAL_HPP
  14. #define ZT_CREDENTIAL_HPP
  15. #include <string>
  16. #include <memory>
  17. #include <stdexcept>
  18. #include <stdio.h>
  19. #include <stdlib.h>
  20. #include <stdint.h>
  21. #include <string.h>
  22. #include "Constants.hpp"
  23. namespace ZeroTier {
  24. /**
  25. * Base class for credentials
  26. */
  27. class Credential
  28. {
  29. public:
  30. /**
  31. * Do not change type code IDs -- these are used in Revocation objects and elsewhere
  32. */
  33. enum Type
  34. {
  35. CREDENTIAL_TYPE_NULL = 0,
  36. CREDENTIAL_TYPE_COM = 1, // CertificateOfMembership
  37. CREDENTIAL_TYPE_CAPABILITY = 2,
  38. CREDENTIAL_TYPE_TAG = 3,
  39. CREDENTIAL_TYPE_COO = 4, // CertificateOfOwnership
  40. CREDENTIAL_TYPE_REVOCATION = 6
  41. };
  42. };
  43. } // namespace ZeroTier
  44. #endif