WvStreams
wvdiffiehellman.h
1/* -*- Mode: C++ -*-
2 * Worldvisions Weaver Software:
3 * Copyright (C) 2003 Net Integration Technologies, Inc.
4 *
5 * Diffie-Hellman shared secret creation.
6 */
7
8#ifndef __WVDIFFIEHELLMAN_H
9#define __WVDIFFIEHELLMAN_H
10
11#include <openssl/dh.h>
12
13#include "wvstream.h"
14#include "wvlog.h"
15
17{
18public:
19 WvDiffieHellman(const unsigned char *_key, int _keylen,
20 BN_ULONG _generator);
21 ~WvDiffieHellman() { DH_free(info); }
22
23 void get_created_secret(WvBuf &outbuf, size_t len);
24 int get_public_value(WvBuf &outbuf, int len);
25
26 int pub_key_len();
27 bool create_secret(WvBuf &inbuf, size_t in_len, WvBuf& outbuf);
28
29protected:
30 DH *info;
31 BN_ULONG generator;
32
33private:
34
35 WvLog log;
36};
37
38#endif /* __WVDIFFIEHELLMAN_H */
A WvLog stream accepts log messages from applications and forwards them to all registered WvLogRcv's.
Definition wvlog.h:57