Virgil Security Crypto library  2.6.3
VirgilCustomParams.h
1 
37 #ifndef VIRGIL_CRYPTO_VIRGIL_CUSTOM_PARAMS_H
38 #define VIRGIL_CRYPTO_VIRGIL_CUSTOM_PARAMS_H
39 
40 #include <map>
41 #include <string>
42 
43 #include "VirgilByteArray.h"
44 #include "foundation/asn1/VirgilAsn1Compatible.h"
45 
46 namespace virgil { namespace crypto {
47 
52 public:
73  virtual size_t asn1Write(
76  size_t childWrittenBytes = 0) const;
77 
80 public:
84 
88  bool isEmpty() const;
90 
94 
98  void setInteger(const VirgilByteArray& key, int value);
99 
104  int getInteger(const VirgilByteArray& key) const;
105 
110  void removeInteger(const VirgilByteArray& key);
111 
115  void setString(const VirgilByteArray& key, const VirgilByteArray& value);
116 
121  VirgilByteArray getString(const VirgilByteArray& key) const;
122 
127  void removeString(const VirgilByteArray& key);
128 
132  void setData(const VirgilByteArray& key, const VirgilByteArray& value);
133 
138  VirgilByteArray getData(const VirgilByteArray& key) const;
139 
144  void removeData(const VirgilByteArray& key);
145 
149  void clear();
151 private:
152  std::map<VirgilByteArray, int> intValues_;
153  std::map<VirgilByteArray, VirgilByteArray> stringValues_;
154  std::map<VirgilByteArray, VirgilByteArray> dataValues_;
155 };
156 
157 }}
158 
159 #endif /* VIRGIL_CRYPTO_VIRGIL_CUSTOM_PARAMS_H */
Data object that represent ASN.1 structure: VirgilCustomParams.
Definition: VirgilCustomParams.h:51
This class provides methods for reading ASN.1 data structure.
Definition: VirgilAsn1Reader.h:53
VirgilByteArray getData(const VirgilByteArray &key) const
Get parameter with type: Data.
void removeData(const VirgilByteArray &key)
Remove parameter with type: Data.
This class provides interface that allow to save and restore object state in the ASN.1 structure.
Definition: VirgilAsn1Compatible.h:59
This class provides methods for writing ASN.1 data structure.
Definition: VirgilAsn1Writer.h:54
void setInteger(const VirgilByteArray &key, int value)
Set parameter with type: Integer.
Root namespace for all Virgil Security libraries.
Definition: VirgilAsn1Compatible.h:46
std::vector< unsigned char > VirgilByteArray
This type represents a sequence of bytes.
Definition: VirgilByteArray.h:50
void setString(const VirgilByteArray &key, const VirgilByteArray &value)
Set parameter with type: String.
void clear()
Remove all parameters.
VirgilByteArray getString(const VirgilByteArray &key) const
Get parameter with type: String.
virtual size_t asn1Write(virgil::crypto::foundation::asn1::VirgilAsn1Writer &asn1Writer, size_t childWrittenBytes=0) const
Write object state to the writer.
int getInteger(const VirgilByteArray &key) const
Get parameter with type: Integer.
void setData(const VirgilByteArray &key, const VirgilByteArray &value)
Set parameter with type: Data.
void removeString(const VirgilByteArray &key)
Remove parameter with type: String.
void removeInteger(const VirgilByteArray &key)
Remove parameter with type: Integer.
bool isEmpty() const
Define whether no one parameter is set.
virtual void asn1Read(virgil::crypto::foundation::asn1::VirgilAsn1Reader &asn1Reader)
Read object state from the reader.