digest-sha256-signature.hpp
1 /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil -*- */
22 #ifndef NDN_DIGEST_SHA256_SIGNATURE_HPP
23 #define NDN_DIGEST_SHA256_SIGNATURE_HPP
24 
25 #include "signature.hpp"
26 
27 namespace ndn {
28 
35 public:
37  : changeCount_(0)
38  {
39  }
40 
45  virtual ptr_lib::shared_ptr<Signature>
46  clone() const;
47 
56  virtual void
57  get(struct ndn_Signature& signatureStruct) const;
58 
64  virtual void
65  set(const struct ndn_Signature& signatureStruct);
66 
71  virtual const Blob&
72  getSignature() const;
73 
78  virtual void
79  setSignature(const Blob& signature);
80 
84  void
86  {
87  signature_.reset();
88  ++changeCount_;
89  }
90 
95  virtual uint64_t
97  {
98  return changeCount_;
99  }
100 
101 private:
102  Blob signature_;
103  uint64_t changeCount_;
104 };
105 
106 
107 }
108 
109 #endif
Copyright (C) 2013-2015 Regents of the University of California.
Definition: common.hpp:35
virtual uint64_t getChangeCount() const
Get the change count, which is incremented each time this object is changed.
Definition: digest-sha256-signature.hpp:96
virtual ptr_lib::shared_ptr< Signature > clone() const
Return a pointer to a new DigestSha256Signature which is a copy of this signature.
Definition: digest-sha256-signature.cpp:31
A Signature is an abstract base class providing methods to work with the signature information in a D...
Definition: signature.hpp:36
A Blob holds a pointer to an immutable byte array implemented as const std::vector.
Definition: blob.hpp:42
virtual void setSignature(const Blob &signature)
Set the signature bytes to the given value.
Definition: digest-sha256-signature.cpp:43
virtual const Blob & getSignature() const
Get the signature bytes (which are only the digest).
Definition: digest-sha256-signature.cpp:37
A DigestSha256Signature extends Signature and holds the signature bits (which are only the SHA256 dig...
Definition: digest-sha256-signature.hpp:34
virtual void set(const struct ndn_Signature &signatureStruct)
Clear this signature, and set the values by copying from the ndn_Signature struct.
Definition: digest-sha256-signature.cpp:60
void clear()
Clear all the fields.
Definition: digest-sha256-signature.hpp:85
An ndn_Signature struct holds the signature bits and other info representing the signature in a data ...
Definition: data-types.h:64