Back to index

obnam  1.1
Public Member Functions | Private Member Functions | Static Private Attributes
obnamlib.encryption.SecretKeyring Class Reference
Inheritance diagram for obnamlib.encryption.SecretKeyring:
Inheritance graph
[legend]
Collaboration diagram for obnamlib.encryption.SecretKeyring:
Collaboration graph
[legend]

List of all members.

Public Member Functions

def keyids
def __str__
def __contains__
def add
def remove
def gpg

Private Member Functions

def _real_keyids

Static Private Attributes

string _keyring_name = 'secring.gpg'

Detailed Description

Same as Keyring, but for secret keys.

Definition at line 215 of file encryption.py.


Member Function Documentation

def obnamlib.encryption.Keyring.__contains__ (   self,
  keyid 
) [inherited]

Definition at line 185 of file encryption.py.

00185 
00186     def __contains__(self, keyid):
00187         return keyid in self.keyids()
        

Here is the call graph for this function:

def obnamlib.encryption.Keyring.__str__ (   self) [inherited]

Definition at line 182 of file encryption.py.

00182 
00183     def __str__(self):
00184         return self._encoded
        

Reimplemented from obnamlib.encryption.Keyring.

Definition at line 221 of file encryption.py.

00221 
00222     def _real_keyids(self):
00223         output = self.gpg(False, ['--list-secret-keys', '--with-colons'])
00224 
00225         keyids = []
00226         for line in output.splitlines():
00227             fields = line.split(':')
00228             if len(fields) >= 5 and fields[0] == 'sec':
00229                 keyids.append(fields[4])
00230         return keyids
00231         

Here is the call graph for this function:

def obnamlib.encryption.Keyring.add (   self,
  key 
) [inherited]

Definition at line 194 of file encryption.py.

00194 
00195     def add(self, key):
00196         self.gpg(True, ['--import'], stdin=key)
        

Here is the call graph for this function:

def obnamlib.encryption.Keyring.gpg (   self,
  reread,
  args,
  kwargs 
) [inherited]

Definition at line 200 of file encryption.py.

00200 
00201     def gpg(self, reread, *args, **kwargs):
00202         self._setup()
00203         kwargs['gpghome'] = self._gpghome
00204         try:
00205             result = _gpg(*args, **kwargs)
00206         except BaseException: # pragma: no cover
00207             self._cleanup()
00208             raise
00209         else:
00210             if reread:
00211                 self._reread_keyring()
00212             self._cleanup()
00213             return result
00214 

Here is the call graph for this function:

Here is the caller graph for this function:

def obnamlib.encryption.Keyring.keyids (   self) [inherited]

Definition at line 177 of file encryption.py.

00177 
00178     def keyids(self):
00179         if self._keyids is None:
00180             self._keyids = self._real_keyids()
00181         return self._keyids
        

Here is the call graph for this function:

Here is the caller graph for this function:

def obnamlib.encryption.Keyring.remove (   self,
  keyid 
) [inherited]

Definition at line 197 of file encryption.py.

00197 
00198     def remove(self, keyid):
00199         self.gpg(True, ['--delete-key', '--yes', keyid])

Here is the call graph for this function:

Here is the caller graph for this function:


Member Data Documentation

string obnamlib.encryption.SecretKeyring._keyring_name = 'secring.gpg' [static, private]

Reimplemented from obnamlib.encryption.Keyring.

Definition at line 219 of file encryption.py.


The documentation for this class was generated from the following file: