<commit_before>Learning Registry Envelope Signing and Validation Module
=========================================================

This is a Python module that may be used to sign, verify, and retrieve
PGP keys for Learning Registry envelopes.


License & Copyright
===================

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


Installation
============

1. Install [GNU Privacy Guard](http://www.gnupg.org/)

2. Download the latest release from the [src/dist](./LRSignature/tree/master/src/dist)

3. Install with pip
        
        pip install LRSignature-<version>.tar.gz
        
4. There is no step four! Done.


Usage
=====

    #!/usr/bin/env python

    from LRSignature.sign.Sign  import Sign_0_21
    from LRSignature.verify.Verify  import Verify_0_21
    import simplejson as json
    
    envelope = '''
            {
                "_id":"00e3f67232e743b6bc2a079bd98ff55a",
                "_rev":"1-8163d32f6cc9996f2b7228d8b5db7962",
                "doc_type":"resource_data",
                "update_timestamp":"2011-03-14 13:36:04.617999",
                "resource_data":"<oai_dc:dc xmlns:oai_dc=\\"http://www.openarchives.org/OAI/2.0/oai_dc/\\" xmlns:dc=\\"http://purl.org/dc/elements/1.1/\\" xmlns:xsi=\\"http://www.w3.org/2001/XMLSchema-instance\\" xmlns=\\"http://www.openarchives.org/OAI/2.0/\\" xsi:schemaLocation=\\"http://www.openarchives.org/OAI/2.0/oai_dc/                          http://www.openarchives.org/OAI/2.0/oai_dc.xsd\\">\\n<dc:title>A chat about America. October and November, 1884.</dc:title>\\n<dc:creator><NAME>.</dc:creator>\\n<dc:subject>United States--Description and travel.</dc:subject>\\n<dc:description>\\"Printed for private circulation only.\\"</dc:description>\\n<dc:description>Electronic reproduction. Washington, D.C. : Library of Congress, [2002-2003]</dc:description>\\n<dc:publisher>Manchester, Palmer &amp; Howe</dc:publisher>\\n<dc:date>1885</dc:date>\\n<dc:type>text</dc:type>\\n<dc:identifier>http://hdl.loc.gov/loc.gdc/lhbtn.12281</dc:identifier>\\n<dc:language>eng</dc:language>\\n<dc:coverage>United States</dc:coverage>\\n</oai_dc:dc>\\n      ",
                "keys":["United States--Description and travel.","eng"],
                "submitter_type":"agent",
                "resource_data_type":"metadata",
                "payload_schema_locator":"http://www.openarchives.org/OAI/2.0/oai_dc/ http://www.openarchives.org/OAI/2.0/oai_dc.xsd",
                "payload_placement":"inline",
                "submitter":"NSDL 2 LR Data Pump",
                "payload_schema":["oai_dc"],
                "node_timestamp":"2011-03-14 13:36:04.617999",
                "doc_version":"0.10.0",
                "create_timestamp":"2011-03-14 13:36:04.617999",
                "active":true,
                "publishing_node":"string",
                "resource_locator":"http://hdl.loc.gov/loc.gdc/lhbtn.12281",
                "doc_ID":"00e3f67232e743b6bc2a079bd98ff55a",
                "TOS": {
                    "submission_TOS": "http://example.com/tos/unknown",
                    "submission_attribution": "unidentified"
                }
            }
            '''
    origJson = json.loads(envelope)
    privateKeyLocation = ["http://www.example.com/example.asc"]
    keyid = "<KEY>"
    passphrase = "<PASSWORD>"

    signtool = Sign_0_21(keyid, passphrase=<PASSWORD>, publicKeyLocations=privateKeyLocation)
    signed = signtool.sign(origJson)
    
    verifytool = Verify_0_21()
    verified = verifytool.verify(signed)
    assert verified == True
    
    
LRSignature.util module contains functionality to fetch and store public keys into the 
local PGP keyring.


Dependencies
============

External:

- GnuPG: http://www.gnupg.org/<commit_msg>updated README.md to reference Wiki<commit_after>Learning Registry Envelope Signing and Validation Module
=========================================================

This is a Python module that may be used to sign, verify, and retrieve
PGP keys for Learning Registry envelopes.

For information on use, see the [LRSignature Wiki](https://github.com/jimklo/LRSignature/wiki).

License & Copyright
===================

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.


Dependencies
============

External:

- GnuPG: http://www.gnupg.org/
{'fraction_non_alphanumeric': 0.15555555555555556, 'fraction_numerical': 0.0389363722697056, 'mean_word_length': 3.169437846397466, 'pattern_counts': {'":': 22, '<': 32, '<?xml version=': 0, '>': 32, 'https://': 1, 'lorem ipsum': 0, 'www.': 13, 'xml': 4}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 1, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4765957', 'n_tokens_mistral': 1748, 'n_tokens_neox': 1559, 'n_words': 383}