WvStreams
debian/libwvstreams-dev/usr/include/wvstreams/wvdsa.h
1/*
2 * Worldvisions Weaver Software:
3 * Copyright (C) 1997-2004 Net Integration Technologies, Inc.
4 *
5 * DSA cryptography abstractions.
6 */
7#ifndef __WVDSA_H
8#define __WVDSA_H
9
10#include "wverror.h"
11#include "wvencoder.h"
12#include "wvencoderstream.h"
13
14struct dsa_st;
15
23class WvDSAKey : public WvErrorBase
24{
25 WvString pub, prv;
26
27 void init(WvStringParm keystr, bool priv);
28 static WvString hexifypub(struct dsa_st *dsa);
29 static WvString hexifyprv(struct dsa_st *dsa);
30
31public:
32 struct dsa_st *dsa;
33
34 WvDSAKey(const WvDSAKey &k);
35 WvDSAKey(struct dsa_st *_dsa, bool priv); // note: takes ownership
36
40 WvDSAKey(WvStringParm keystr, bool priv);
41
45 WvDSAKey(int bits);
46
47 ~WvDSAKey();
48
49 virtual bool isok() const;
50
57 { return prv; }
58
63 { return pub; }
64
69 WvString getpem(bool privkey);
70};
71
72
73#endif // __WVDSA_H
An DSA public key or public/private key pair that can be used for encryption.
WvString public_str() const
Retrieve the public key as a hexified string.
WvString private_str() const
Retrieve the private key as a hexified string returns WvString::null if there is only a public key.
virtual bool isok() const
By default, returns true if geterr() == 0.
Definition wvdsa.cc:66
WvString getpem(bool privkey)
Retrieve the public or private key in PEM encoded format.
Definition wvdsa.cc:116
A class for managing error numbers and strings.
A WvFastString acts exactly like a WvString, but can take (const char *) strings without needing to a...
WvString is an implementation of a simple and efficient printable-string class.