Part of lp.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.|
|Parameters||keyfile||The name of the file to be imported.|
content and password must be traditional strings. It's up to the caller to encode or decode properly.
|Unknown Field: content||encrypted data content|
|Unknown Field: password||unicode password to unlock the secret key in question|