IBR-DTN  1.0.0
JPAKEProtocol.h
Go to the documentation of this file.
1 /*
2  * JPAKEProtocol.h
3  *
4  * Copyright (C) 2014 IBR, TU Braunschweig
5  *
6  * Written-by: Johannes Morgenroth <morgenroth@ibr.cs.tu-bs.de>
7  * Thomas Schrader <schrader.thomas@gmail.com>
8  *
9  * Licensed under the Apache License, Version 2.0 (the "License");
10  * you may not use this file except in compliance with the License.
11  * You may obtain a copy of the License at
12  *
13  * http://www.apache.org/licenses/LICENSE-2.0
14  *
15  * Unless required by applicable law or agreed to in writing, software
16  * distributed under the License is distributed on an "AS IS" BASIS,
17  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
18  * See the License for the specific language governing permissions and
19  * limitations under the License.
20  *
21  */
22 
23 #ifndef JPAKEPROTOCOL_H_
24 #define JPAKEPROTOCOL_H_
25 
29 
30 #include <openssl/jpake.h>
31 
32 namespace dtn
33 {
34  namespace security
35  {
37  {
38  public:
40  virtual ~JPAKEProtocol();
41 
42  virtual KeyExchangeSession* createSession(const dtn::data::EID &peer, unsigned int uniqueId);
43 
44  virtual void begin(KeyExchangeSession &session, KeyExchangeData &data);
45  virtual void step(KeyExchangeSession &session, KeyExchangeData &data);
46 
47  private:
48  class JPAKEState : public dtn::security::KeyExchangeSession::SessionState
49  {
50  public:
51  JPAKEState();
52  virtual ~JPAKEState();
53  JPAKE_CTX* ctx;
54  std::string step1;
55  };
56 
57  static void write(std::ostream &stream, const BIGNUM* bn);
58  static void read(std::istream &stream, BIGNUM **bn);
59  };
60  } /* namespace security */
61 } /* namespace dtn */
62 
63 #endif /* JPAKEPROTOCOL_H_ */
virtual KeyExchangeSession * createSession(const dtn::data::EID &peer, unsigned int uniqueId)
virtual void step(KeyExchangeSession &session, KeyExchangeData &data)
virtual void begin(KeyExchangeSession &session, KeyExchangeData &data)
JPAKEProtocol(KeyExchangeManager &manager)