secretmessage.h revision 7c9978567a202d6aa98beac5da5e1b3b34792862
1// Copyright 2012 Google Inc. All Rights Reserved. 2// 3// Licensed under the Apache License, Version 2.0 (the "License"); 4// you may not use this file except in compliance with the License. 5// You may obtain a copy of the License at 6// 7// http://www.apache.org/licenses/LICENSE-2.0 8// 9// Unless required by applicable law or agreed to in writing, software 10// distributed under the License is distributed on an "AS IS" BASIS, 11// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12// See the License for the specific language governing permissions and 13// limitations under the License. 14 15#ifndef POLO_PAIRING_MESSAGE_SECRETMESSAGE_H_ 16#define POLO_PAIRING_MESSAGE_SECRETMESSAGE_H_ 17 18#include <stdint.h> 19#include <string> 20#include <vector> 21#include "polo/pairing/message/polomessage.h" 22 23namespace polo { 24namespace pairing { 25namespace message { 26 27// Message used to pass the pairing secret. The secret consists of encoded 28// bytes. 29class SecretMessage : public PoloMessage { 30 public: 31 // Creates a new message for the given secret. 32 // @param secret the secret 33 explicit SecretMessage(const std::vector<uint8_t>& secret); 34 35 // Gets the secret. 36 const std::vector<uint8_t>& secret() const; 37 38 // @override 39 virtual std::string ToString() const; 40 private: 41 std::vector<uint8_t> secret_; 42 43 DISALLOW_COPY_AND_ASSIGN(SecretMessage); 44}; 45 46} // namespace message 47} // namespace pairing 48} // namespace polo 49 50#endif // POLO_PAIRING_MESSAGE_SECRETMESSAGE_H_ 51