encrypt-params.hpp
1 /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil -*- */
23 #ifndef NDN_ENCRYPT_PARAMS_HPP
24 #define NDN_ENCRYPT_PARAMS_HPP
25 
26 #include "../../util/blob.hpp"
27 #include "../../c/encrypt/algo/encrypt-params-types.h"
28 
29 namespace ndn {
30 
37 public:
45  (ndn_EncryptAlgorithmType algorithmType, size_t initialVectorLength);
46 
52  EncryptParams(ndn_EncryptAlgorithmType algorithmType)
53  {
54  algorithmType_ = algorithmType;
55  }
56 
61  ndn_EncryptAlgorithmType
62  getAlgorithmType() const { return algorithmType_; }
63 
68  const Blob&
69  getInitialVector() const { return initialVector_; }
70 
77  setAlgorithmType(ndn_EncryptAlgorithmType algorithmType)
78  {
79  algorithmType_ = algorithmType;
80  return *this;
81  }
82 
90  setInitialVector(const Blob& initialVector)
91  {
92  initialVector_ = initialVector;
93  return *this;
94  }
95 
96 private:
97  ndn_EncryptAlgorithmType algorithmType_;
98  Blob initialVector_;
99 };
100 
101 }
102 
103 #endif
Copyright (C) 2013-2016 Regents of the University of California.
Definition: common.hpp:36
EncryptParams & setInitialVector(const Blob &initialVector)
Set the initial vector.
Definition: encrypt-params.hpp:90
EncryptParams(ndn_EncryptAlgorithmType algorithmType, size_t initialVectorLength)
Create an EncryptParams with the given parameters.
Definition: encrypt-params.cpp:31
EncryptParams(ndn_EncryptAlgorithmType algorithmType)
Create an EncryptParams with the given algorithmType and an unspecified initial vector.
Definition: encrypt-params.hpp:52
An EncryptParams holds an algorithm type and other parameters used to encrypt and decrypt...
Definition: encrypt-params.hpp:36
A Blob holds a pointer to an immutable byte array implemented as const std::vector.
Definition: blob.hpp:42
ndn_EncryptAlgorithmType getAlgorithmType() const
Get the algorithm type.
Definition: encrypt-params.hpp:62
EncryptParams & setAlgorithmType(ndn_EncryptAlgorithmType algorithmType)
Set the algorithm type.
Definition: encrypt-params.hpp:77
const Blob & getInitialVector() const
Get the initial vector.
Definition: encrypt-params.hpp:69