File: pkey.h

package info (click to toggle)
pyopenssl 0.13-2%2Bdeb7u1
  • links: PTS, VCS
  • area: main
  • in suites: wheezy
  • size: 1,752 kB
  • sloc: ansic: 7,372; python: 6,688; perl: 3,089; xml: 693; makefile: 191; sh: 54; lisp: 13; sed: 2
file content (52 lines) | stat: -rw-r--r-- 1,401 bytes parent folder | download
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
48
49
50
51
52
/*
 * pkey.h
 *
 * Copyright (C) AB Strakt
 * Copyright (C) Jean-Paul Calderone
 * See LICENSE for details.
 *
 * Export pkey functions and data structure.
 * See the file RATIONALE for a short explanation of why this module was written.
 *
 */
#ifndef PyOpenSSL_crypto_PKEY_H_
#define PyOpenSSL_crypto_PKEY_H_

extern  int       init_crypto_pkey   (PyObject *);

extern  PyTypeObject    crypto_PKey_Type;

#define crypto_PKey_Check(v) ((v)->ob_type == &crypto_PKey_Type)

typedef struct {
    PyObject_HEAD

    /*
     * A pointer to the underlying OpenSSL structure.
     */
    EVP_PKEY            *pkey;

    /*
     * A flag indicating the underlying pkey object has no private parts (so it
     * can't sign, for example).  This is a bit of a temporary hack.
     * Public-only should be represented as a different type. -exarkun
     */
    int                  only_public;

    /*
     * A flag indicating whether the underlying pkey object has no meaningful
     * data in it whatsoever.  This is a temporary hack.  It should be
     * impossible to create PKeys in an unusable state. -exarkun
     */
    int                  initialized;

    /*
     * A flag indicating whether pkey will be freed when this object is freed.
     */
    int                  dealloc;
} crypto_PKeyObj;

#define crypto_TYPE_RSA           EVP_PKEY_RSA
#define crypto_TYPE_DSA           EVP_PKEY_DSA

#endif