Module Expr Str Import alias alias alias Import alias ImportFrom alias identifier ClassDef bases AttributeLoad NameLoad attr body Expr Str FunctionDef arguments args NameParam NameParam defaults body TryExcept body Expr Call AttributeLoad NameLoad attr NameLoad handlers ExceptHandler type NameLoad name NameStore body If CompareEq AttributeLoad NameLoad attr AttributeLoad NameLoad attr body Pass orelse Raise decorator_list FunctionDef arguments args NameParam NameParam defaults body For TupleStore NameStore NameStore NameStore Call AttributeLoad NameLoad attr NameLoad body For NameStore NameLoad body Expr Call AttributeLoad NameLoad attr Call AttributeLoad AttributeLoad NameLoad attr attr NameLoad NameLoad Expr Call AttributeLoad NameLoad attr NameLoad decorator_list FunctionDef arguments args NameParam NameParam NameParam defaults body TryExcept body Expr Call AttributeLoad NameLoad attr NameLoad NameLoad handlers ExceptHandler body Pass decorator_list FunctionDef arguments args NameParam defaults body Assign AttributeStore NameLoad attr Call AttributeLoad AttributeLoad NameLoad attr attr Call AttributeLoad AttributeLoad NameLoad attr attr Call AttributeLoad AttributeLoad NameLoad attr attr Str Str Assign AttributeStore NameLoad attr Str Expr Call AttributeLoad NameLoad attr AttributeLoad NameLoad attr Expr Call AttributeLoad NameLoad attr AttributeLoad NameLoad attr Assign AttributeStore NameLoad attr Call AttributeLoad NameLoad attr keyword AttributeLoad NameLoad attr keyword AttributeLoad NameLoad attr Assign AttributeStore NameLoad attr Str Assign AttributeStore NameLoad attr Str Assign AttributeStore NameLoad attr Str decorator_list FunctionDef arguments args NameParam defaults body Expr Call AttributeLoad NameLoad attr AttributeLoad NameLoad attr Pass decorator_list FunctionDef arguments args NameParam NameParam NameParam defaults Str body Expr Str Assign NameStore Call AttributeLoad AttributeLoad NameLoad attr attr keyword NameLoad Assign NameStore Call NameLoad NameLoad Assign NameStore Call AttributeLoad AttributeLoad NameLoad attr attr NameLoad Assert BoolOpAnd CompareNotEq NameLoad NameLoad CompareEq AttributeLoad NameLoad attr Num Call AttributeLoad Str attr NameLoad Assign NameStore Call AttributeLoad AttributeLoad NameLoad attr attr keyword NameLoad Assert CompareEq Call NameLoad NameLoad BinOpAdd NameLoad Num Call AttributeLoad Str attr NameLoad decorator_list FunctionDef arguments args NameParam defaults body Expr Str Assign NameStore Str Assign NameStore Call AttributeLoad NameLoad attr NameLoad Assert CompareEq Call NameLoad NameLoad Num Str Expr Call AttributeLoad NameLoad attr SubscriptLoad NameLoad Index Num keyword Str decorator_list FunctionDef arguments args NameParam defaults body Expr Str Assign NameStore Str Assign NameStore Call AttributeLoad NameLoad attr NameLoad Assert CompareEq Call NameLoad NameLoad Num Str Expr Call AttributeLoad NameLoad attr SubscriptLoad NameLoad Index Num keyword Str decorator_list FunctionDef arguments args NameParam defaults body Expr Str Assign NameStore Str Assign NameStore Call AttributeLoad NameLoad attr NameLoad Assert CompareEq Call NameLoad NameLoad Num Str Expr Call AttributeLoad NameLoad attr SubscriptLoad NameLoad Index Num keyword Str decorator_list FunctionDef arguments args NameParam defaults body Expr Str Assign NameStore Str Assign NameStore Call AttributeLoad NameLoad attr NameLoad Assert CompareEq Call NameLoad NameLoad Num Str Expr Call AttributeLoad NameLoad attr SubscriptLoad NameLoad Index Num keyword Str decorator_list FunctionDef arguments args NameParam defaults body Expr Str Assign NameStore Str Assign NameStore Call AttributeLoad NameLoad attr NameLoad Assert CompareEq Call NameLoad NameLoad Num Str Expr Call AttributeLoad NameLoad attr SubscriptLoad NameLoad Index Num keyword Str Expr Call AttributeLoad NameLoad attr SubscriptLoad NameLoad Index Num keyword Str decorator_list FunctionDef arguments args NameParam defaults body Expr Str Assign NameStore Str Assign NameStore Call AttributeLoad NameLoad attr NameLoad Assert CompareEq Call NameLoad NameLoad Num Str Expr Call AttributeLoad NameLoad attr SubscriptLoad NameLoad Index Num keyword Str decorator_list FunctionDef arguments args NameParam defaults body Expr Str Assign NameStore Call AttributeLoad AttributeLoad NameLoad attr attr keyword NameLoad For NameStore NameLoad body Assert CompareNotEq SubscriptLoad NameLoad Index Str AttributeLoad NameLoad attr Str Assign NameStore Call NameLoad NameLoad Assign NameStore Call AttributeLoad NameLoad attr AttributeLoad NameLoad attr keyword AttributeLoad NameLoad attr keyword AttributeLoad NameLoad attr Assert CompareEq NameLoad Num Str Assign NameStore Call AttributeLoad AttributeLoad NameLoad attr attr keyword NameLoad Assert CompareEq Call NameLoad NameLoad Num Str For NameStore NameLoad body Assert CompareEq SubscriptLoad NameLoad Index Str AttributeLoad NameLoad attr Str decorator_list FunctionDef arguments args NameParam defaults body Expr Str Assign NameStore Call AttributeLoad AttributeLoad NameLoad attr attr keyword NameLoad For NameStore NameLoad body Assert CompareNotEq SubscriptLoad NameLoad Index Str AttributeLoad NameLoad attr Str Assign NameStore Call NameLoad NameLoad Assign NameStore Call AttributeLoad NameLoad attr AttributeLoad NameLoad attr keyword AttributeLoad NameLoad attr keyword AttributeLoad NameLoad attr Assert CompareEq NameLoad Num Str Assign NameStore Call AttributeLoad NameLoad attr AttributeLoad NameLoad attr keyword AttributeLoad NameLoad attr keyword AttributeLoad NameLoad attr Assert CompareEq NameLoad Num Str Assign NameStore Call AttributeLoad AttributeLoad NameLoad attr attr keyword NameLoad Assert CompareEq Call NameLoad NameLoad Num Str For NameStore NameLoad body Assert CompareEq SubscriptLoad NameLoad Index Str AttributeLoad NameLoad attr Str decorator_list decorator_list If CompareEq NameLoad Str body Expr Call AttributeLoad NameLoad attr
N/A N/A 
Copyright 2011 SRI International

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

    http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.

Created on May 11, 2011

@author: jklo
 N/A unittest os errno N/A gnupg LRSignature util util Test N/A N/A unittest TestCase N/A N/A Unit test cases for testing utility methods mkdir_p N/A N/A self path N/A N/A N/A N/A N/A N/A N/A os makedirs path N/A N/A N/A OSError N/A exc N/A N/A N/A N/A exc errno N/A errno EEXIST N/A N/A N/A N/A N/A rm_rf N/A N/A self path N/A N/A N/A N/A r d f N/A N/A os walk path N/A N/A files f N/A N/A N/A N/A os remove N/A N/A N/A os path join r files N/A N/A N/A os removedirs r N/A chmod N/A N/A self path mode N/A N/A N/A N/A N/A N/A N/A os chmod path mode N/A N/A N/A N/A N/A setUp N/A N/A self N/A N/A N/A N/A self gnupghome N/A N/A N/A os path expanduser N/A N/A N/A os path abspath N/A N/A N/A os path join .. gnupg_home N/A N/A self gpgbin gpg N/A N/A N/A self rm_rf N/A self gnupghome N/A N/A N/A self mkdir_p N/A self gnupghome N/A N/A self gpg N/A N/A gnupg GPG gnupghome N/A self gnupghome gpgbinary N/A self gpgbin N/A N/A self sampleKeyId A8A790EA220403B7 N/A N/A self sampleKeyFingerprint E8BCBCB8994A293C10DDCBC5A8A790EA220403B7 N/A N/A self sampleKey -----BEGIN PGP PUBLIC KEY BLOCK-----
Version: PGP Universal 2.9.1 (Build 347)

mQMuBE2k6UsRCACZq+E+DpcRH/FDtMlih5SKpzsFyvOfH1ENfkVFUTjoHa96kG/D
VblOYbmtIHmB3TwnOZ4XzZYu/Xz9arT2UX0KfWvR8TmnvYqIe7NZ4aQy1dizI3tY
YLUre6k9xB5dI21h8GCWJ9JTPoTvONh2n0F0GqHwaY33RfgOMyNs34Y3lILPsNdr
rBzLt98XleyN/TQisEHHdJArNsn+rR/hqVDUzXWSoW8g1rmH8Edn+fre/pDgS6wC
a6QbxAWJn1jI9hkzRnJ4jzJF2VoFKSGiUd3oIafNgdeawqNNTDpN6yvculQ78Giq
1HOXfYxJ+i8TyyuJv5jPVZzZhrkXI4ugwiefAQDm5xp9YiPUitbVFbz2LFiXT7hZ
qAyNMjiYHxHELDymJQf9EE/0Ugf9/7C2DOYtooqVP0Gl/ULhS55NhIvPsjmIpVab
l3yMQvsOt+vUdg3VXUtJaVMlO6cybDWcd+y3+1T9UPySmjwWsxvVo/KG5F6Eq1wZ
6mcecUZ6tyB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hqqbSR9rhoxh6KCNeW/UzzdZYpSUXB
LA5skakLjVvoiVnt8s3l3TzZZ1Sv1GLuc0IiiGCDkYpfBzbSfq68l5BAUUypVUYB
/HVwXOWh2bgCwbEYMrkCDQRNpOlLEAgA9Nf3erVlYGru7rxhKZfSxFJQHdFluHXT
6hmRhG7+foSEAXUt1z0gm17RQcktY1KSi5S6UQ8IRs11gWME8yAwVhtW2SwFp+No
+2L2pJdHgz+0dvbQqTdOy//ugWibQPXvirLEmbJCBmsMX6Hi1sA4NROFFDcYt3nk
mNK1St52/v43lK7EOeruK7tq/17LN25X9AitV8RXkci4s3eqmUWfljaJWilyW8EA
cQcxUxRW8HgwTFDz5HvNqetH1rPtb3gkiw9JPMsRioIyyVRK1qJ1JPFpvRAE8wvQ
aKbt5u8GMKOEFDDqqaaTx+99GQAtaQ1IzwO6Ta1LNEpMcduD7v5EiwADBQf8CbZQ
dx1PvDNcs0y4HBF3VeEzvy6jFXOfEMG0+G1iqlEeaGIGok2Ym0XtwEOvJ0ZwCcgs
fpgIMNzluiUXiz27UnkPoKppnsAJMMNIWoD+O9xUybNkuXYMBZFZhkiudeJVlI1J
wURvypW5rZMuB+uvAqz0oR/AP97fZ5zC//CpaHoSaOLwsf0Oo6eU2XrFdNhcIMct
5WAQXgfODKa/Zv6CWjnxUmjuBZvHZKoxaqua+gubH51kxNYazu9XU2ABYwVJtAi2
WE9hkKCe8CWvPLQtcNFpT+JChe6HNaZDlfjIKmHxSGUGmdGLF0WBvaE3tv8gZI9F
jKMjh7u6KvlSTajYfIhhBBgRCAAJBQJNpOlLAhsMAAoJEKinkOoiBAO3oaoA/1OX
5zIsnKPrWr273Y1KNJuFEavlqmlkUGUaQQQ1sNY5AQDXjrJB/qU5FrrewgCGtst3
Mi8vo0LKU7qAlMXpAa5+tw==
=aCWc
-----END PGP PUBLIC KEY BLOCK----- N/A tearDown N/A N/A self N/A N/A N/A N/A N/A self rm_rf N/A self gnupghome N/A N/A checkKey N/A N/A self key keysource N/A N/A N/A Utility method to check to see if fetched key is valid by importing into GPG keyring N/A keys N/A N/A N/A self gpg list_keys secret False N/A numkeys N/A len keys N/A result N/A N/A N/A self gpg import_keys key N/A N/A N/A result None N/A N/A result imported 1 N/A N/A GPG import does not indicate key import occurred for {0}. format keysource N/A keys N/A N/A N/A self gpg list_keys secret False N/A N/A N/A len keys N/A numkeys 1 N/A N/A Imported key did not get added to keyring for {0}. format keysource N/A testPGPFetchKey N/A N/A self N/A N/A N/A Attempt to retrieve key via HTTP GET from Symantec's PGP keyserver N/A keyURL http://keyserver.pgp.com/vkd/DownloadKey.event?keyid=0xA8A790EA220403B7 N/A fetchedKeys N/A N/A util fetchkeys keyURL N/A N/A N/A len fetchedKeys 1 key could not be retrieved from URL N/A N/A N/A self checkKey N/A fetchedKeys N/A 0 keysource PGP sourced key N/A testSKSFetchKey N/A N/A self N/A N/A N/A Attempt to retrieve key via HTTP GET from SKS keyserver N/A keyURL http://pool.sks-keyservers.net:11371/pks/lookup?op=get&search=0xA8A790EA220403B7 N/A fetchedKeys N/A N/A util fetchkeys keyURL N/A N/A N/A len fetchedKeys 1 key could not be retrieved from URL N/A N/A N/A self checkKey N/A fetchedKeys N/A 0 keysource SKS source key N/A testWebSiteFetchKey N/A N/A self N/A N/A N/A Attempt to retrieve key via HTTP GET that is a part of an HTML web page N/A keyURL http://sites.google.com/site/learningregistrytestdata/home/single-public-pgp-key N/A fetchedKeys N/A N/A util fetchkeys keyURL N/A N/A N/A len fetchedKeys 1 key could not be retrieved from URL N/A N/A N/A self checkKey N/A fetchedKeys N/A 0 keysource HTML Web Page sourced key N/A testHTTPFetchKey N/A N/A self N/A N/A N/A Attempt to retrieve key via HTTP GET that is a part of a file download request N/A keyURL http://sites.google.com/site/learningregistrytestdata/home/single-public-pgp-key/key0xA8A790EA220403B7.asc?attredirects=0&d=1 N/A fetchedKeys N/A N/A util fetchkeys keyURL N/A N/A N/A len fetchedKeys 1 key could not be retrieved from URL N/A N/A N/A self checkKey N/A fetchedKeys N/A 0 keysource HTTP Download sourced key N/A testMultipleFetchKey N/A N/A self N/A N/A N/A Attempt to retrieve multiple keys via HTTP GET that is a part of a file download request N/A keyURL http://sites.google.com/site/learningregistrytestdata/home/multiple-public-pgp-keys N/A fetchedKeys N/A N/A util fetchkeys keyURL N/A N/A N/A len fetchedKeys 2 keys could not be retrieved from URL N/A N/A N/A self checkKey N/A fetchedKeys N/A 0 keysource HTTP Download sourced key 1 N/A N/A N/A self checkKey N/A fetchedKeys N/A 1 keysource HTTP Download sourced key 2 N/A testGoogleDocFetchKey N/A N/A self N/A N/A N/A Attempt to retrieve key via HTTP file download via Google Docs N/A keyURL https://docs.google.com/uc?id=0ByJYdR0YE41yNDg2ZTkzYTItNmJjNC00YTgwLTkyYzctZTNiMzAwYzhjYTdh&export=download&hl=en N/A fetchedKeys N/A N/A util fetchkeys keyURL N/A N/A N/A len fetchedKeys 1 key could not be retrieved from URL N/A N/A N/A self checkKey N/A fetchedKeys N/A 0 keysource Google Doc source key N/A testStoreKey N/A N/A self N/A N/A N/A Use a known ASCII Armored key and store it via util.storekey(...) N/A keys N/A N/A N/A self gpg list_keys secret False N/A key keys N/A N/A N/A N/A key N/A keyid N/A self sampleKeyId Imported sample key already in keyring N/A numkeys N/A len keys N/A numImported N/A N/A util storekey N/A self sampleKey gnupghome N/A self gnupghome gpgbin N/A self gpgbin N/A N/A numImported 1 sample key not imported into keyring N/A keys N/A N/A N/A self gpg list_keys secret False N/A N/A N/A len keys 1 no key found matching id N/A key keys N/A N/A N/A N/A key N/A keyid N/A self sampleKeyId exported key is not expected N/A testStoreExistingKey N/A N/A self N/A N/A N/A Use a known ASCII Armored key and try storing it twice.  It should not get imported a second time N/A keys N/A N/A N/A self gpg list_keys secret False N/A key keys N/A N/A N/A N/A key N/A keyid N/A self sampleKeyId Imported sample key already in keyring N/A numkeys N/A len keys N/A numImported N/A N/A util storekey N/A self sampleKey gnupghome N/A self gnupghome gpgbin N/A self gpgbin N/A N/A numImported 1 sample key not imported into keyring N/A numImported N/A N/A util storekey N/A self sampleKey gnupghome N/A self gnupghome gpgbin N/A self gpgbin N/A N/A numImported 0 sample key imported when it shouldn't have been into keyring N/A keys N/A N/A N/A self gpg list_keys secret False N/A N/A N/A len keys 1 no key found matching id N/A key keys N/A N/A N/A N/A key N/A keyid N/A self sampleKeyId exported key is not expected N/A N/A N/A N/A __name__ __main__ N/A N/A N/A N/A unittest main