summaryrefslogtreecommitdiff
path: root/lib/dns/sec/dnssafe/ahgen.h
blob: 7240e2e1f251c2a369307b422664f310af8289ea (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
/* Copyright (C) RSA Data Security, Inc. created 1990, 1996.  This is an
   unpublished work protected as such under copyright law.  This work
   contains proprietary, confidential, and trade secret information of
   RSA Data Security, Inc.  Use, disclosure or reproduction without the
   express written authorization of RSA Data Security, Inc. is
   prohibited.
 */

#ifndef _AHGEN_H_
#define _AHGEN_H_ 1

#include "btypechk.h"

/* Use the THIS_GENERATE macro to define the type of object in the
     virtual function prototype.  It defaults to the most base class, but
     derived modules may define the macro to a more derived class before
     including this header file.
 */
#ifndef THIS_GENERATE
#define THIS_GENERATE struct AHGenerate
#endif

struct AHGenerate;

typedef struct {
  void (*Destructor) PROTO_LIST ((THIS_GENERATE *));
  int (*GenerateInit) PROTO_LIST
    ((THIS_GENERATE *, B_ALGORITHM_CHOOSER, A_SURRENDER_CTX *));
  int (*GenerateKeypair) PROTO_LIST
    ((THIS_GENERATE *, B_Key *, B_Key *, B_Algorithm *, A_SURRENDER_CTX *));
  int (*GenerateParameters) PROTO_LIST
    ((THIS_GENERATE *, B_Algorithm *, B_Algorithm *, A_SURRENDER_CTX *));
} AHGenerateVTable;

typedef struct AHGenerate {
  B_TypeCheck typeCheck;                                        /* inherited */
  AHGenerateVTable *vTable;                                  /* pure virtual */
} AHGenerate;

/* The constructor does not set the vTable since this is a pure base class.
 */
void AHGenerateConstructor PROTO_LIST ((AHGenerate *));
/* No destructor because it is pure virtual. Also, do not call destructor
     for B_TypeCheck, since this will just re-invoke this virtual
     destructor. */

#endif