Python: module pyme.core

pyme.core | index /home/jgoerzen/tree/pyme-0.5.1/build/lib.linux-ppc-2.2/pyme/core.py

`# Copyright (C) 2002 John Goerzen
# <jgoerzen@complete.org>
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA`

Modules
`` |  |
pyme.aux | pyme.errors | pyme.gpgme |

Classes
`` |  | pyme.util.GpgmeWrapper Context Data Recipients
class Context(pyme.util.GpgmeWrapper)
`` | `From the GPGME C documentation: * All cryptographic operations in GPGME are performed within a * context, which contains the internal state of the operation as well as * configuration parameters. By using several contexts you can run * several cryptographic operations in parallel, with different * configuration. Thus, this is the place that you will usually start.`
| Methods defined here: __del__(self) __init__(self) _errorcheck(self, name) _free_passcb(self) _free_progresscb(self) _getctype(self) _getnameprepend(self) op_keylist_next(self) `Returns the next key in the list created by a call to op_keylist_start(). The object returned is of type Key.` op_keylist_start(self, pattern=None, secret_only=0) `Start an iteration over a GPG keyring by using the gpgme_op_keylist_start() function. You can then use GpgmeCtx.op_keylist_next() to retrieve values. Or, you can use the return value of op_keylist_start -- an iterator -- to loop over them. For instance: for i in c.op_keylist_start(): print i NOTE: unless you use op_keylist_end() OR you consume all items from op_keylist_start, your Context will raise a Busy exception if you try to perform any other operation!` set_passphrase_cb(self, func, hook) `Sets the passphrase callback to the function specified by func. When the system needs a passphrase, it will call func with two args: desc, a string describing the passphrase it needs; and hook, the data passed in as hook here. The hook argument is mandatory for obscure technical reasons (Python hands the C code a 'cell' instead of a tuple if I made this optional.) It is suggested that you pass a None value for hook if your called functions do not require a specific hook value. Please see the GPGME manual for more information.` set_progress_cb(self, func, hook) `Sets the progress meter callback to the function specified by This function will be called to provide an interactive update of the system's progress. The hook argument is mandatory for obscure technical reasons (Python hands the C code a 'cell' instead of a tuple if I made this optional.) It is suggested that you pass a None value for hook if your called functions do not require a specific hook value. Please see the GPGME manual for more information.` Data and non-method functions defined here: __doc__ = 'From the GPGME C documentation:\n\n * All crypt...s, this is the place that you will usually start.' __module__ = 'pyme.core' Methods inherited from pyme.util.GpgmeWrapper: __getattr__(self, name) `On-the-fly function generation.` __repr__(self) __str__(self)
class Data(pyme.util.GpgmeWrapper)
`` | `From the GPGME C manual: * A lot of data has to be exchanged between the user and the crypto * engine, like plaintext messages, ciphertext, signatures and information * about the keys. The technical details about exchanging the data * information are completely abstracted by GPGME. The user provides and * receives the data via `GpgmeData' objects, regardless of the * communication protocol between GPGME and the crypto engine in use. This Data class is the implementation of the GpgmeData objects. Please see the information about __init__ for instantiation.`
| Methods defined here: __del__(self) __init__(self, string=None, file=None, offset=None, length=None, cb=None) `Initialize a new GpgmeData object. If no args are specified, make it an empty object. If string alone is specified, initialize it with the data contained there. If file, offset, and length are all specified, file must be either a filename or a file-like object, and the object will be initialized by reading the specified chunk from the file. If cb is specified, it MUST be a tuple of: (func, hook) where func is a callback function taking two arguments (count, hook) and returning a string of read data, or None on EOF. This will supply the read() method for the system. If file is specified without any other arguments, then it must be a filename, and the object will be initialized from that file. Any other use will result in undefined or erroneous behavior.` _errorcheck(self, name) _free_readcb(self) _getctype(self) _getnameprepend(self) _newptr(self) _ptrdel(self) _ptrval(self) new(self) new_from_file(self, filename, copy=1) new_from_filepart(self, file, offset, length) `This wraps the GPGME gpgme_data_new_from_filepart() function. The argument "file" may be: 1. a string specifying a file name, or 3. a a file-like object. supporting the fileno() call and the mode attribute.` new_from_mem(self, string) new_with_read_cb(self, func, hook) read(self, size=-1) `Read at most size bytes, returned as a string. If the size argument is negative or omitted, read until EOF is reached. Returns the data read, or the empty string if there was no data to read before EOF was reached.` write(self, buffer) Data and non-method functions defined here: __doc__ = 'From the GPGME C manual:\n\n* A lot of data has to...the information about __init__ for instantiation.' __module__ = 'pyme.core' Methods inherited from pyme.util.GpgmeWrapper: __getattr__(self, name) `On-the-fly function generation.` __repr__(self) __str__(self)
class Recipients(pyme.util.GpgmeWrapper)
`` | `This object is used to identify a set of keys that are: a) used as the recipients of an encryption process; or b) used for a list of keys to export`
| Methods defined here: __del__(self) __init__(self) __iter__(self) _errorcheck(self, name) _getctype(self) _getnameprepend(self) add(self, name, validity=None) `Adds a new recipient to the list. If validity is specified, sets the trust value to it. (equivolent to add_name_with_validity()) If validity is not specified, uses the system default. (equivolent to add_name())` Data and non-method functions defined here: __doc__ = 'This object is used to identify a set of keys th...or\n b) used for a list of keys to export\n\n ' __module__ = 'pyme.core' Methods inherited from pyme.util.GpgmeWrapper: __getattr__(self, name) `On-the-fly function generation.` __repr__(self) __str__(self)

Data
`` |  | __file__ = '/home/jgoerzen/tree/pyme-0.5.1/build/lib.linux-ppc-2.2/pyme/core.pyc' __name__ = 'pyme.core'