The SWORD Project  1.9.0.svnversion
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
swcipher.h
Go to the documentation of this file.
1 /******************************************************************************
2  *
3  * swcipher.h - class SWCipher: used for data cipher/decipher
4  *
5  * $Id: swcipher.h 3786 2020-08-30 11:35:14Z scribe $
6  *
7  * Copyright 1999-2013 CrossWire Bible Society (http://www.crosswire.org)
8  * CrossWire Bible Society
9  * P. O. Box 2528
10  * Tempe, AZ 85280-2528
11  *
12  * This program is free software; you can redistribute it and/or modify it
13  * under the terms of the GNU General Public License as published by the
14  * Free Software Foundation version 2.
15  *
16  * This program is distributed in the hope that it will be useful, but
17  * WITHOUT ANY WARRANTY; without even the implied warranty of
18  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
19  * General Public License for more details.
20  *
21  */
22 
23 #ifndef SWCIPHER_H
24 #define SWCIPHER_H
25 
26 #include <sapphire.h>
27 
28 #include <defs.h>
29 #include <swbuf.h>
30 
32 
34 
35 private:
38 
39  char *buf;
40  bool cipher;
41  unsigned long len;
42 
43 protected:
44 
45 public:
46  SWCipher(unsigned char *key);
47  virtual void setCipherKey(const char *key);
48  virtual ~SWCipher();
49  virtual void setUncipheredBuf(const char *buf = 0, unsigned long len = 0);
50  virtual char *getUncipheredBuf();
51  virtual void setCipheredBuf(unsigned long *len, const char *buf = 0);
52  virtual char *getCipheredBuf(unsigned long *len = 0);
53  virtual void encode(void);
54  virtual void decode(void);
55  static SWBuf personalize(const SWBuf &buf, bool encode);
56 };
57 
59 #endif
Sapphire work
Definition: swcipher.h:37
#define SWORD_NAMESPACE_START
Definition: defs.h:39
Sapphire master
Definition: swcipher.h:36
Definition: swbuf.h:47
#define SWDLLEXPORT
Definition: defs.h:171
char * buf
Definition: swcipher.h:39
bool cipher
Definition: swcipher.h:40
unsigned long len
Definition: swcipher.h:41
#define SWORD_NAMESPACE_END
Definition: defs.h:40