Package conary :: Package lib :: Module openpgpkey :: Class OpenPGPKeyFileCache
[hide private]
[frames] | no frames]

Class OpenPGPKeyFileCache

source code

OpenPGPKeyCache --+
                  |
                 OpenPGPKeyFileCache

OpenPGPKeyCache based object that reads keys from public and private keyrings

Instance Methods [hide private]
 
__init__(self, callback=None)
__init__ (PUBLIC API)
source code
 
_setPrivateKeyringPath(self, privatePath=None) source code
 
setPublicPath(self, path) source code
 
setTrustDbPath(self, path) source code
 
addPublicPath(self, path) source code
 
setPrivatePath(self, path) source code
 
setCallback(self, callback)
setCallback (PUBLIC API)
source code
bool
getPublicKey(self, keyId, label=None, warn=True)
Retrieve a public key.
source code
 
_getPublicKey(self, keyId, label=None, warn=True) source code
 
getPublicKeyring(self) source code
 
getPrivateKey(self, keyId, passphrase=None)
Retrieve the private key.
source code

Inherited from OpenPGPKeyCache: remove, reset

Method Details [hide private]

__init__(self, callback=None)
(Constructor)

source code 
__init__ (PUBLIC API)
Decorators:
  • @api.publicApi
Overrides: OpenPGPKeyCache.__init__

setCallback(self, callback)

source code 
setCallback (PUBLIC API)
Decorators:
  • @api.publicApi

getPublicKey(self, keyId, label=None, warn=True)

source code 
Retrieve a public key.
Parameters:
  • keyId (str) - the key ID
  • label (versions.Label or string) - a label to retrieve the key from
  • warn (bool) - (True by default) warn if key is not available
Returns: bool
True if the key was found
Overrides: OpenPGPKeyCache.getPublicKey

getPrivateKey(self, keyId, passphrase=None)

source code 
Retrieve the private key.
Parameters:
  • keyId (str) - the key ID
  • passphrase (str) - an optional passphrase. If not specified, one will be read from the terminal if it is needed.
Raises:
  • BadPassPrhase - if the passphrase was incorrect
  • KeyNotFound - if the key was not found
Overrides: OpenPGPKeyCache.getPrivateKey