diff options
author | Arthur de Jong <arthur@arthurdejong.org> | 2016-03-27 17:53:26 +0200 |
---|---|---|
committer | Arthur de Jong <arthur@arthurdejong.org> | 2016-03-27 17:53:26 +0200 |
commit | b4a6c720cb202f44b07ad2d0f9d8812ab7212ea5 (patch) | |
tree | fe056384a6a3112dd6ca9f34f3d722413fe931e1 /docs/usage.rst | |
parent | 8b5f6c27e0dde5f8b995b89dd2e3c9fa3caed3d5 (diff) | |
parent | 59aa65be6d3349e78d2f17e94ae34f6767113a87 (diff) |
Implement writing encrypted files
This adds support for setting up encryption keys and password-based key
derivation when writing PSKC files. Also MAC keys are set up when
needed.
Diffstat (limited to 'docs/usage.rst')
-rw-r--r-- | docs/usage.rst | 25 |
1 files changed, 12 insertions, 13 deletions
diff --git a/docs/usage.rst b/docs/usage.rst index 7a9cdcb..5e0edfc 100644 --- a/docs/usage.rst +++ b/docs/usage.rst @@ -1,13 +1,13 @@ Basic usage =========== -The :mod:`pskc` module implements a simple and efficient API for parsing PSKC -files. The :class:`~pskc.PSKC` class is used to access the file as a whole -which provides access to a list of :class:`~pskc.key.Key` instances which -contain most of the useful information from the PSKC file. +The :mod:`pskc` module implements a simple and efficient API for parsing and +creating PSKC files. The :class:`~pskc.PSKC` class is used to access the file +as a whole which provides access to a list of :class:`~pskc.key.Key` +instances which contain most of the useful information of the PSKC file. -Opening a PSKC file +Reading a PSKC file ------------------- Importing data from a PSKC file can be done by instantiating the @@ -50,16 +50,15 @@ adding keys with :func:`~pskc.PSKC.add_key()` and writing the result:: >>> from pskc import PSKC >>> pskc = PSKC() - >>> key = pskc.add_key(id='456', manufacturer='Manufacturer') - >>> key.id - '456' - >>> key.secret = '987654321' - >>> key.algorithm = 'urn:ietf:params:xml:ns:keyprov:pskc:hotp' + >>> key = pskc.add_key( + ... id='456', secret='987654321', manufacturer='Manufacturer', + ... algorithm = 'urn:ietf:params:xml:ns:keyprov:pskc:hotp') >>> pskc.write('output.pskcxml') -Writing the data in encrypted form in the PSKC file is not yet supported so -currently opening an encrypted PSKC file, providing the encryption key and -writing the file should result in the same file but with encryption removed. +By default an unencrypted PSKC file will be created but an encryption can be +configured using the +:func:`~pskc.encryption.Encryption.setup_preshared_key()` or +:func:`~pskc.encryption.Encryption.setup_pbkdf2()` function. The PSKC class |