Module Expr Str Import alias Import alias Import alias Import alias Import alias alias ImportFrom alias ImportFrom alias FunctionDef arguments args NameParam NameParam defaults body FunctionDef arguments args NameParam defaults body Return ListComp Call NameLoad NameLoad comprehension NameStore Call AttributeLoad Call AttributeLoad NameLoad attr Str Str NameLoad attr Str decorator_list Return Call NameLoad Call NameLoad NameLoad Call NameLoad NameLoad decorator_list ClassDef bases NameLoad body Expr Str FunctionDef arguments args NameParam NameParam NameParam NameParam NameParam NameParam NameParam defaults NameLoad NameLoad Call AttributeLoad AttributeLoad NameLoad attr attr Call AttributeLoad AttributeLoad NameLoad attr attr Str Str Str ListLoad NameLoad body Expr Str Assign AttributeStore NameLoad attr Str Assign AttributeStore NameLoad attr NameLoad Assign AttributeStore NameLoad attr NameLoad Assign AttributeStore NameLoad attr NameLoad Assign AttributeStore NameLoad attr NameLoad Assign AttributeStore NameLoad attr NameLoad Assign AttributeStore NameLoad attr Str Assign AttributeStore NameLoad attr NameLoad Assign AttributeStore NameLoad attr Call AttributeLoad NameLoad attr keyword AttributeLoad NameLoad attr keyword AttributeLoad NameLoad attr Assign NameStore Call AttributeLoad AttributeLoad NameLoad attr attr keyword NameLoad If CompareNotEq NameLoad NameLoad body Assign NameStore NameLoad For NameStore NameLoad body If CompareEq SubscriptLoad NameLoad Index Str AttributeLoad NameLoad attr body Assign NameStore NameLoad Assign AttributeStore NameLoad attr NameLoad Break If CompareEq SubscriptLoad NameLoad Index Str AttributeLoad NameLoad attr body Assign NameStore NameLoad Assign AttributeStore NameLoad attr NameLoad If CompareEq NameLoad NameLoad body Raise Call NameLoad AttributeLoad NameLoad attr decorator_list FunctionDef arguments args NameParam NameParam defaults body Return CompareGtE Call NameLoad SubscriptLoad NameLoad Index Str AttributeLoad NameLoad attr Num decorator_list FunctionDef arguments args NameParam NameParam defaults Dict body If Call NameLoad NameLoad AttributeLoad NameLoad attr body Return Str orelse If Call NameLoad NameLoad AttributeLoad NameLoad attr body Return Call AttributeLoad Call NameLoad NameLoad attr orelse If Call NameLoad NameLoad TupleLoad AttributeLoad NameLoad attr AttributeLoad NameLoad attr AttributeLoad NameLoad attr AttributeLoad NameLoad attr body Print Call AttributeLoad Str attr NameLoad Raise Call NameLoad Str orelse If Call NameLoad NameLoad AttributeLoad NameLoad attr body Return NameLoad orelse If Call NameLoad NameLoad AttributeLoad NameLoad attr body Return NameLoad orelse If Call NameLoad NameLoad AttributeLoad NameLoad attr body Assign NameStore ListLoad For NameStore NameLoad body TryExcept body Expr Call AttributeLoad NameLoad attr Call AttributeLoad NameLoad attr NameLoad handlers ExceptHandler type NameLoad body Pass Return NameLoad orelse If Call NameLoad NameLoad AttributeLoad NameLoad attr body For NameStore Call AttributeLoad NameLoad attr body TryExcept body Assign SubscriptStore NameLoad Index NameLoad Call AttributeLoad NameLoad attr SubscriptLoad NameLoad Index NameLoad handlers ExceptHandler type NameLoad body Pass Return NameLoad orelse Return NameLoad decorator_list FunctionDef arguments args NameParam NameParam defaults Dict body Assign NameStore ListLoad Str Str Str Str Str Str Str Str Assign NameStore Call AttributeLoad NameLoad attr NameLoad For NameStore NameLoad body If Call AttributeLoad NameLoad attr NameLoad body Delete SubscriptDel NameLoad Index NameLoad Return NameLoad decorator_list FunctionDef arguments args NameParam NameParam defaults Dict body Assign NameStore Call NameLoad NameLoad Return NameLoad decorator_list FunctionDef arguments args NameParam NameParam defaults body Assign NameStore Call AttributeLoad Call AttributeLoad NameLoad attr Call AttributeLoad NameLoad attr Str attr Return NameLoad decorator_list FunctionDef arguments args NameParam NameParam defaults body Expr Str Assign NameStore Call AttributeLoad NameLoad attr NameLoad Assign NameStore Call AttributeLoad NameLoad attr NameLoad Assign NameStore Call AttributeLoad NameLoad attr NameLoad Assign NameStore Call AttributeLoad NameLoad attr NameLoad Return NameLoad decorator_list FunctionDef arguments args NameParam defaults body If BoolOpAnd Call AttributeLoad AttributeLoad NameLoad attr attr Str Call NameLoad SubscriptLoad AttributeLoad NameLoad attr Index Str AttributeLoad NameLoad attr body Return Call AttributeLoad Str attr SubscriptLoad AttributeLoad NameLoad attr Index Str Return NameLoad decorator_list FunctionDef arguments args NameParam NameParam defaults body Assign NameStore Dict Str Str Str NameLoad AttributeLoad NameLoad attr AttributeLoad NameLoad attr Assign NameStore Call AttributeLoad NameLoad attr If CompareNotEq NameLoad NameLoad body Assign SubscriptStore NameLoad Index Str NameLoad Return NameLoad decorator_list FunctionDef arguments args NameParam NameParam defaults body Expr Str If BoolOpOr Call AttributeLoad NameLoad attr NameLoad AttributeLoad NameLoad attr body Assign NameStore Call AttributeLoad NameLoad attr NameLoad Assign NameStore Dict Str Str Str AttributeLoad NameLoad attr AttributeLoad NameLoad attr NameLoad Assign NameStore Call AttributeLoad AttributeLoad NameLoad attr attr NameLoad NameLoad Assign SubscriptStore NameLoad Index Str Call AttributeLoad NameLoad attr AttributeLoad NameLoad attr Return NameLoad decorator_list decorator_list If CompareEq NameLoad Str body Assign NameStore Call NameLoad Str keyword Str
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 Apr 27, 2011

@author: jklo
 N/A re N/A hashlib N/A gnupg N/A types N/A os copy LRSignature.errors UnknownKeyException LRSignature.bencode bencode _cmp_version N/A N/A version1 version2 N/A N/A normalize N/A N/A v N/A N/A N/A N/A N/A int x N/A x N/A N/A N/A N/A re sub (\.0+)*$ v split . N/A N/A N/A cmp N/A normalize version1 N/A normalize version2 N/A Sign_0_21 N/A object N/A N/A 
    Class for signing LR envelopes following version 0.21.0 of the LR Specification:
        see: https://docs.google.com/document/d/191BTary350To_4JokBUFZLFRMOEfGYrl_EHE6QZxUr8/edit
     __init__ N/A N/A self privateKeyID passphrase gnupgHome gpgbin publicKeyLocations sign_everything N/A None None N/A N/A N/A os path expanduser N/A N/A N/A os path join ~ .gnupg /usr/local/bin/gpg N/A True N/A N/A 
        Constructor
         N/A N/A self signatureMethod LR-PGP.1.0 N/A N/A self privateKeyID privateKeyID N/A N/A self passphrase passphrase N/A N/A self gnupgHome gnupgHome N/A N/A self gpgbin gpgbin N/A N/A self publicKeyLocations publicKeyLocations N/A N/A self min_doc_version 0.21.0 N/A N/A self sign_everything sign_everything N/A N/A self gpg N/A N/A gnupg GPG gnupghome N/A self gnupgHome gpgbinary N/A self gpgbin N/A secretKeys N/A N/A N/A self gpg list_keys secret True N/A N/A privateKeyID None N/A N/A privateKeyAvailable False N/A skey secretKeys N/A N/A N/A N/A skey N/A keyid N/A self privateKeyID N/A N/A privateKeyAvailable True N/A N/A self privateKeyInfo skey N/A N/A N/A N/A skey N/A fingerprint N/A self privateKeyID N/A N/A privateKeyAvailable True N/A N/A self privateKeyInfo skey N/A N/A privateKeyAvailable False N/A N/A N/A UnknownKeyException N/A self privateKeyID N/A _version_check N/A N/A self doc N/A N/A N/A N/A N/A _cmp_version N/A doc N/A doc_version N/A self min_doc_version 0 N/A _bnormal N/A N/A self obj N/A N/A N/A N/A N/A isinstance obj N/A types NoneType N/A N/A null N/A N/A N/A isinstance obj N/A types BooleanType N/A N/A N/A N/A N/A str obj lower N/A N/A N/A isinstance obj N/A N/A types FloatType N/A types IntType N/A types LongType N/A types ComplexType N/A N/A N/A N/A Dropping number: {0}
 format obj N/A N/A TypeError Numbers not permitted N/A N/A N/A isinstance obj N/A types StringType N/A N/A obj N/A N/A N/A isinstance obj N/A types UnicodeType N/A N/A obj N/A N/A N/A isinstance obj N/A types ListType N/A N/A nobj N/A N/A child obj N/A N/A N/A N/A N/A N/A nobj append N/A N/A self _bnormal child N/A N/A N/A TypeError N/A N/A N/A nobj N/A N/A N/A isinstance obj N/A types DictType N/A N/A key N/A N/A obj keys N/A N/A N/A N/A N/A obj N/A key N/A N/A self _bnormal N/A obj N/A key N/A N/A N/A TypeError N/A N/A N/A obj N/A N/A obj N/A _stripEnvelope N/A N/A self envelope N/A N/A N/A N/A fields N/A digital_signature publishing_node update_timestamp node_timestamp create_timestamp doc_ID _id _rev N/A sigObj N/A N/A copy deepcopy envelope N/A field fields N/A N/A N/A N/A sigObj has_key field N/A N/A N/A sigObj N/A field N/A sigObj N/A _buildCanonicalString N/A N/A self envelope N/A N/A N/A N/A encoded N/A bencode envelope N/A encoded N/A _hash N/A N/A self msg N/A N/A N/A hashedDigest N/A N/A N/A N/A hashlib sha256 N/A N/A msg encode utf-8 hexdigest N/A hashedDigest N/A get_message N/A N/A self envelope N/A N/A N/A 
        Hashes the contents of an LR envelope in the following manner:
        
            1. remove all fields from envelope except for the following:
                "doc_type", "doc_version", "resource_data_type", "active", "submitter_type", "submitter",
                "submitter_timestamp", "submitter_TTL",  "submission_TOS", "submission_attribution",
                "resource_locator", "keys", "resource_TTL", "payload_placement"
            2. Bencode the remaining envelope [http://en.wikipedia.org/wiki/Bencode]
            3. Hash the Bencoded string using a SHA256
            4. Convert SHA256 to hexadecimal digest.
            
        Returns digest as string.
         N/A stripped N/A N/A self _stripEnvelope envelope N/A normalized N/A N/A self _bnormal stripped N/A canonical N/A N/A self _buildCanonicalString normalized N/A hashedDigest N/A N/A self _hash canonical N/A hashedDigest N/A _get_privatekey_owner N/A N/A self N/A N/A N/A N/A N/A N/A N/A self privateKeyInfo has_key uids N/A isinstance N/A N/A self privateKeyInfo N/A uids N/A types ListType N/A N/A N/A N/A ,  join N/A N/A self privateKeyInfo N/A uids N/A None N/A _get_sig_block N/A N/A self sigdata N/A N/A N/A signature N/A signature key_location signing_method sigdata N/A self publicKeyLocations N/A self signatureMethod N/A pkowner N/A N/A self _get_privatekey_owner N/A N/A pkowner None N/A N/A N/A signature N/A key_owner pkowner N/A signature N/A sign N/A N/A self envelope N/A N/A N/A 
        Hashes and Signs a LR envelope according to the version 2.0 LR Specification
         N/A N/A N/A N/A self _version_check envelope N/A self sign_everything N/A N/A msg N/A N/A self get_message envelope N/A signPrefs N/A keyid passphrase clearsign N/A self privateKeyID N/A self passphrase True N/A result N/A N/A N/A self gpg sign msg signPrefs N/A N/A envelope N/A digital_signature N/A N/A self _get_sig_block N/A result data N/A envelope N/A N/A N/A N/A __name__ __main__ N/A N/A sign N/A Sign_0_21 C37C805D164B052C passphrase 2dimples