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