l.t.gpgkeys : package documentation

Part of lp.testing

OpenPGP keys used for testing.

There are two GPG keys located in the 'gpgkeys' sub directory, one for Sample Person and for Foo Bar. The passwords for the secret keys are 'test'.

Before they are used in tests they need to be imported, so that GpgHandler knows about them. import_public_test_keys() imports all public keys available, while import_public_key(email_addr) only imports the key associated with that specific email address.

Secret keys are also imported into the local key ring, they are used for decrypt data in pagetests.

From the __init__.py module:

Function decrypt_content Return the decrypted content or None if failed
Function import_public_key Imports the public key related to the given email address.
Function import_public_test_keys Imports all the public keys located in gpgkeysdir into the db.
Function import_secret_test_key Imports the secret key located in gpgkeysdir into local keyring.
Function iter_test_key_emails Iterates over the email addresses for the keys in the gpgkeysdir.
Function test_keyrings Iterate over the filenames for test keyrings.
Function test_pubkey_file_from_email Get the file name for a test pubkey by email address.
Function test_pubkey_from_email Get the on disk content for a test pubkey by email address.
def import_public_key(email_addr):
Imports the public key related to the given email address.
def iter_test_key_emails():
Iterates over the email addresses for the keys in the gpgkeysdir.
def import_public_test_keys():
Imports all the public keys located in gpgkeysdir into the db.
def import_secret_test_key(keyfile='test@canonical.com.sec'):
Imports the secret key located in gpgkeysdir into local keyring.
ParameterskeyfileThe name of the file to be imported.
def test_pubkey_file_from_email(email_addr):
Get the file name for a test pubkey by email address.
def test_pubkey_from_email(email_addr):
Get the on disk content for a test pubkey by email address.
def test_keyrings():
Iterate over the filenames for test keyrings.
def decrypt_content(content, password):
Return the decrypted content or None if failed

content and password must be traditional strings. It's up to the caller to encode or decode properly.

Unknown Field: contentencrypted data content
Unknown Field: passwordunicode password to unlock the secret key in question
API Documentation for Launchpad, generated by pydoctor at 2018-02-25 00:00:04.