All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
signature-sha256.hpp
Go to the documentation of this file.
1 /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil -*- */
7 #ifndef NDN_SECURITY_SIGNATURE_SHA256_HPP
8 #define NDN_SECURITY_SIGNATURE_SHA256_HPP
9 
10 #include "../data.hpp"
11 #include "../encoding/tlv.hpp"
12 
13 namespace ndn {
14 
18 class SignatureSha256 : public Signature
19 {
20 public:
21  class Error : public Signature::Error
22  {
23  public:
24  explicit
25  Error(const std::string& what)
26  : Signature::Error(what)
27  {
28  }
29  };
30 
32  {
34 
37  }
38 
39  SignatureSha256(const Signature& signature)
40  : Signature(signature)
41  {
42  if (getType() != Signature::Sha256)
43  throw Error("Incorrect signature type");
44  }
45 };
46 
47 } // namespace ndn
48 
49 #endif //NDN_SECURITY_SIGNATURE_SHA256_HPP
Block nonNegativeIntegerBlock(uint32_t type, uint64_t value)
int32_t m_type
Definition: signature.hpp:114
Representing of SHA256 signature in a data packet.
Class representing wire element of the NDN packet.
Definition: block.hpp:26
Error(const std::string &what)
uint32_t getType() const
Definition: signature.hpp:50
void push_back(const Block &element)
Definition: block.hpp:390
SignatureType
Definition: tlv.hpp:66
SignatureSha256(const Signature &signature)
A Signature is storage for the signature-related information (info and value) in a Data packet...
Definition: signature.hpp:15