Arthur de Jong

Open Source / Free Software developer

summaryrefslogtreecommitdiffstats
path: root/pskc/policy.py
Commit message (Collapse)AuthorAgeFilesLines
* Support separate device from keyArthur de Jong2016-09-171-2/+2
| | | | | | | | This allows having multiple keys per device while also maintaining the previous API. Note that having multiple keys per device is not allowed by the RFC 6030 schema but is allowed by some older internet drafts.
* Move XML generation to own moduleArthur de Jong2016-09-171-24/+0
| | | | | Similar to the change for parsing, move the XML serialisation of PSKC data to a single class in a separate module.
* Move document parsing to own moduleArthur de Jong2016-09-171-41/+0
| | | | | | This moves all the parse() functions to a single class in a dedicated module that can be used for parsing PSKC files. This should make it easier to subclass the parser.
* Remove parse call from constructorsArthur de Jong2016-04-051-2/+1
| | | | This makes the creation if internal instances a litte more consistent.
* Also check key expiry in may_use()Arthur de Jong2016-03-231-2/+24
|
* Implement policy checkingArthur de Jong2016-03-191-7/+17
| | | | | This checks for unknown policy elements in the PSKC file and will cause the key usage policy check to fail.
* Strip XML namespaces before parsingArthur de Jong2016-01-241-6/+6
| | | | | | | | | This simplifies calls to the find() family of functions and allows parsing PSKC files that have slightly different namespace URLs. This is especially common when parsing old draft versions of the specification. This also removes passing multiple patterns to the find() functions that was introduced in 68b20e2.
* Support Python 3Arthur de Jong2015-10-061-2/+2
| | | | | | | | This enables support for Python 3 together with Python 2 support with a single codebase. On Python 3 key data is passed around as bytestrings which makes the doctests a little harder to maintain across Python versions.
* Rename pskc.parse to pskc.xmlArthur de Jong2014-10-091-2/+2
| | | | | | | This renames the parse module to xml to better reflect the purpose of the module and it's functions. This also introduces a parse() function that wraps etree.parse().
* Construct XML document with basic PKSC informationArthur de Jong2014-06-281-0/+26
| | | | | | This introduces make_xml() functions to build an XML document that contains the basic PSKC information and keys. This currently only supports writing unencrypted PSKC files.
* Refactor out some functions to parseArthur de Jong2014-06-151-10/+6
| | | | | This introduces the getint() and getbool() functions in parse to avoid some code duplication.
* Have parse module provide find() functionsArthur de Jong2014-06-141-9/+7
| | | | | | | | This changes the parse module functions to better match the ElementTree API and extends it with findint(), findtime() and findbin(). It also passes the namespaces to all calls that require it without duplicating this throughout the normal code.
* Use get() instead of attrib.get() (shorter)Arthur de Jong2014-06-141-12/+12
|
* Add missing policy constantArthur de Jong2014-05-191-0/+3
|
* Complete pskc.policy docstringsArthur de Jong2014-04-191-2/+4
| | | | Also contains small consistency improvement.
* Move Key class to separate moduleArthur de Jong2014-04-191-2/+3
| | | | This also allows re-organising the imports a bit.
* Document key and pin usage valuesArthur de Jong2014-04-111-0/+42
|
* Implement key policy parsingArthur de Jong2014-04-111-0/+116
This parses key policy from PSKC files and provides a few utility methods to help with policy validation.