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(SignatureLite& signatureLite) const;
58 
63  virtual void
64  set(const SignatureLite& signatureLite);
65 
70  virtual const Blob&
71  getSignature() const;
72 
77  virtual void
78  setSignature(const Blob& signature);
79 
83  void
85  {
86  signature_.reset();
87  ++changeCount_;
88  }
89 
94  virtual uint64_t
95  getChangeCount() const;
96 
97 private:
98  Blob signature_;
99  uint64_t changeCount_;
100 };
101 
102 
103 }
104 
105 #endif
Copyright (C) 2013-2016 Regents of the University of California.
Definition: common.hpp:35
A SignatureLite holds a signature type, a KeyLocatorLite, the signature bytes and other fields to rep...
Definition: signature-lite.hpp:36
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:30
A Signature is an abstract base class providing methods to work with the signature information in a D...
Definition: signature.hpp:35
A Blob holds a pointer to an immutable byte array implemented as const std::vector.
Definition: blob.hpp:42
virtual void set(const SignatureLite &signatureLite)
Clear this signature, and set the values by copying from signatureLite.
Definition: digest-sha256-signature.cpp:59
virtual void setSignature(const Blob &signature)
Set the signature bytes to the given value.
Definition: digest-sha256-signature.cpp:42
virtual const Blob & getSignature() const
Get the signature bytes (which are only the digest).
Definition: digest-sha256-signature.cpp:36
A DigestSha256Signature extends Signature and holds the signature bits (which are only the SHA256 dig...
Definition: digest-sha256-signature.hpp:34
void clear()
Clear all the fields.
Definition: digest-sha256-signature.hpp:84
virtual uint64_t getChangeCount() const
Get the change count, which is incremented each time this object is changed.
Definition: digest-sha256-signature.cpp:69