client-cpp  0.10.0
SecurityDefinitions.hpp
Go to the documentation of this file.
1 /*
2  * Copyright 2014-2016 CyberVision, Inc.
3  *
4  * Licensed under the Apache License, Version 2.0 (the "License");
5  * you may not use this file except in compliance with the License.
6  * You may obtain a copy of the License at
7  *
8  * http://www.apache.org/licenses/LICENSE-2.0
9  *
10  * Unless required by applicable law or agreed to in writing, software
11  * distributed under the License is distributed on an "AS IS" BASIS,
12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  * See the License for the specific language governing permissions and
14  * limitations under the License.
15  */
16 
17 #ifndef SECURITYDEFINITIONS_HPP_
18 #define SECURITYDEFINITIONS_HPP_
19 
20 #include <string>
21 #include <botan/botan.h>
22 
23 namespace kaa {
24 
25 typedef Botan::secure_vector<std::uint8_t> PublicKey;
26 typedef std::string PrivateKey;
27 
28 typedef Botan::SymmetricKey SessionKey;
29 typedef Botan::secure_vector<std::uint8_t> EncodedSessionKey;
30 
31 typedef Botan::secure_vector<std::uint8_t> Signature;
32 
33 class KeyPair
34 {
35 public:
36  KeyPair(const PublicKey& pubKey, const PrivateKey& privKey) : pubKey_(pubKey), privKey_(privKey) { }
37  KeyPair(const KeyPair& other) : pubKey_(other.pubKey_), privKey_(other.privKey_) { }
38  KeyPair& operator=(const KeyPair& other) { pubKey_ = other.pubKey_; privKey_ = other.privKey_; return *this; }
39  ~KeyPair() { }
40 
41  const PublicKey& getPublicKey() const { return pubKey_; }
42  const PrivateKey& getPrivateKey() const { return privKey_; }
43 
44 private:
45  PublicKey pubKey_;
46  PrivateKey privKey_;
47 };
48 
49 }
50 
51 #endif /* KAA_SECURITY_SECURITYDEFINITIONS_HPP_ */
const PublicKey & getPublicKey() const
Botan::secure_vector< std::uint8_t > PublicKey
const PrivateKey & getPrivateKey() const
KeyPair & operator=(const KeyPair &other)
KeyPair(const KeyPair &other)
Botan::SymmetricKey SessionKey
KeyPair(const PublicKey &pubKey, const PrivateKey &privKey)
Botan::secure_vector< std::uint8_t > Signature
Botan::secure_vector< std::uint8_t > EncodedSessionKey
std::string PrivateKey