sshfp_44.h 1.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859
  1. // Copyright (C) 2012 Internet Systems Consortium, Inc. ("ISC")
  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 ISC DISCLAIMS ALL WARRANTIES WITH
  8. // REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
  9. // AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT,
  10. // INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
  11. // LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE
  12. // OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
  13. // PERFORMANCE OF THIS SOFTWARE.
  14. // BEGIN_HEADER_GUARD
  15. #include <stdint.h>
  16. #include <string>
  17. #include <dns/name.h>
  18. #include <dns/rdata.h>
  19. // BEGIN_ISC_NAMESPACE
  20. // BEGIN_COMMON_DECLARATIONS
  21. // END_COMMON_DECLARATIONS
  22. // BEGIN_RDATA_NAMESPACE
  23. class SSHFP : public Rdata {
  24. public:
  25. // BEGIN_COMMON_MEMBERS
  26. // END_COMMON_MEMBERS
  27. SSHFP(uint8_t algorithm, uint8_t fingerprint_type, const std::string& fingerprint);
  28. ///
  29. /// Specialized methods
  30. ///
  31. uint8_t getAlgorithmNumber() const;
  32. uint8_t getFingerprintType() const;
  33. size_t getFingerprintLen() const;
  34. private:
  35. /// Note: this is a prototype version; we may reconsider
  36. /// this representation later.
  37. uint8_t algorithm_;
  38. uint8_t fingerprint_type_;
  39. std::vector<uint8_t> fingerprint_;
  40. };
  41. // END_RDATA_NAMESPACE
  42. // END_ISC_NAMESPACE
  43. // END_HEADER_GUARD
  44. // Local Variables:
  45. // mode: c++
  46. // End: