Initial import to Tizen
[profile/ivi/python-pyOpenSSL.git] / OpenSSL / crypto / pkey.h
1 /*
2  * pkey.h
3  *
4  * Copyright (C) AB Strakt
5  * Copyright (C) Jean-Paul Calderone
6  * See LICENSE for details.
7  *
8  * Export pkey functions and data structure.
9  * See the file RATIONALE for a short explanation of why this module was written.
10  *
11  */
12 #ifndef PyOpenSSL_crypto_PKEY_H_
13 #define PyOpenSSL_crypto_PKEY_H_
14
15 extern  int       init_crypto_pkey   (PyObject *);
16
17 extern  PyTypeObject    crypto_PKey_Type;
18
19 #define crypto_PKey_Check(v) ((v)->ob_type == &crypto_PKey_Type)
20
21 typedef struct {
22     PyObject_HEAD
23
24     /*
25      * A pointer to the underlying OpenSSL structure.
26      */
27     EVP_PKEY            *pkey;
28
29     /*
30      * A flag indicating the underlying pkey object has no private parts (so it
31      * can't sign, for example).  This is a bit of a temporary hack.
32      * Public-only should be represented as a different type. -exarkun
33      */
34     int                  only_public;
35
36     /*
37      * A flag indicating whether the underlying pkey object has no meaningful
38      * data in it whatsoever.  This is a temporary hack.  It should be
39      * impossible to create PKeys in an unusable state. -exarkun
40      */
41     int                  initialized;
42
43     /*
44      * A flag indicating whether pkey will be freed when this object is freed.
45      */
46     int                  dealloc;
47 } crypto_PKeyObj;
48
49 #define crypto_TYPE_RSA           EVP_PKEY_RSA
50 #define crypto_TYPE_DSA           EVP_PKEY_DSA
51
52 #endif